Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gigya Web SDK integration - setup Flutter Web entrypoint #69

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

navaronbracke
Copy link
Contributor

@navaronbracke navaronbracke commented Jun 5, 2023

This PR adds the web entrypoint for the example app.
The example web app won't run properly yet, since it currently lacks the most basic implementation of initSdk(), logout(), isLoggedIn(). Implementing that is done in #45

Part of #44

Changelog

Because we now have a web implementation part, I moved the method channel related stuff to its own folder

  • moves method channel specific files into the src/method_channel folder (Android & iOS implementations)
  • moves the various service interfaces to the src/services folder

Model class related changes

  • adds the session cookie properties to the SessionInfo class
  • Fix: Use followersCount instead of followersCounts when converting a Profile from JSON
  • adds support for the data parameter in the Account class

BREAKING CHANGES

  • Dart 3.0 and Flutter 3.10 are now the minimum supported version
    • This enables some features, such as switch expressions. As there have been several major releases (3.10, 3.13 and 3.16) I felt that it was the right time to bump the version constraint (also in preparation for the web version in the future)
  • The SessionInfo class attributes are now nullable to account for differences between web and native
  • Account.socialProviders is now a list of strings, which improves type safety
  • Timestamps in the Account class have been refactored to become DateTime? instances.
    • The timestamp attributes have been renamed to their UTC string SAP SDK counterparts:
      • created, lastLogin, lastUpdated, oldestDataUpdated, registered, verified
      • signatureTimestamp has been updated to handle int, double and String for its parsing
    • The integer based timestamp fields have been removed, as the DateTime equivalents provide a better typing
  • The startDate and endDate of a Certification is now a DateTime?, instead of String
  • The timestamp field has been removed from the Like class. The time of a Like is now a DateTime
  • The ConflictingAccounts class has been renamed to ConflictingAccount, the (web SDK) documentation uses singular for this object.

///
/// The map is expected to have an `event` key, denoting the name of the event.
/// The map can have a `data` key, which is a [Map] that contains any data for the event.
factory ScreensetEvent.fromMap(Map<Object?, Object?> map) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this constructor makes the yield implementation a bit cleaner, since we can just rely on a tear-off and let dart format format the call-chain for us

// The binary messenger sends things back as `dynamic`,
// but the events are actually a `Map<Object?, Object?>`.
// Cast using the `map()` Stream transformer.
yield* screenSetEvents
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combining a stream transformer + a tear-off makes this read better.

@navaronbracke navaronbracke changed the title Gigya Web SDK integration - setup web entrypoint Gigya Web SDK integration - setup Flutter Web entrypoint Sep 25, 2023
@navaronbracke
Copy link
Contributor Author

@tal-mi As the work for the Biometrics service has been merged into main now, I have made the following changes to this pull request:

  • I have moved the biometrics_service.dart into the /services folder, to follow the same pattern as the other services
  • I have moved the method_channel_biometrics_service.dart into the /method_channel folder, so that all the MethodChannel implementations are located in the same place.
  • I ran dart format . and committed the formatting changes that were not applied yet.
  • I ran dart analyze . and fixed one lint warning that was reported.

Once we get this pull request reviewed and merged, we can more easily split up the web implementation parts into smaller pieces. The PR's that I have opened for that, are currently drafts because most of their diffs are what is contained in this PR.

@EArminjon EArminjon mentioned this pull request Sep 26, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant