init method

void init(
  1. {required GlobalKey<NavigatorState> appNavigator,
  2. AtSyncUIOverlay? atSyncUIOverlay = AtSyncUIOverlay.dialog,
  3. AtSyncUIStyle? style,
  4. bool? showTextWhileSyncing,
  5. Function? onSuccessCallback,
  6. Function? onErrorCallback,
  7. Function? syncProgressCallback,
  8. Function? onAtSignRemoved,
  9. Color? primaryColor,
  10. Color? backgroundColor,
  11. Color? labelColor,
  12. bool showRemoveAtsignOption = false}

appNavigator is used for navigation purpose atSyncUIOverlay decides whether dialog or snackbar to be shown while syncing style if material or cupertino style to be applied showTextWhileSyncing should text be shown while syncing onSuccessCallback called after successful sync onErrorCallback called after failure in sync syncProgressCallback Notifies the registered listener for the SyncProgress primaryColor,backgroundColor, labelColor will be used while displaying overlay/snackbar. if showRemoveAtsignOption is true, onAtSignRemoved will be called if atSign is removed successfully from device


void init(
    {required GlobalKey<NavigatorState> appNavigator,
    AtSyncUIOverlay? atSyncUIOverlay = AtSyncUIOverlay.dialog,
    AtSyncUIStyle? style,
    bool? showTextWhileSyncing,
    Function? onSuccessCallback,
    Function? onErrorCallback,
    Function? syncProgressCallback,
    Function? onAtSignRemoved,
    Color? primaryColor,
    Color? backgroundColor,
    Color? labelColor,
    bool showRemoveAtsignOption = false}) {
  this.onSuccessCallback = onSuccessCallback;
  this.onErrorCallback = onErrorCallback;
  this.syncProgressCallback = syncProgressCallback;
  this.onAtSignRemoved = onAtSignRemoved;

  /// change status to notStarted

  if (style != null) {
    atSyncUIStyle = style;
  if (atSyncUIOverlay != null) {
    this.atSyncUIOverlay = atSyncUIOverlay;
  this.showTextWhileSyncing = showTextWhileSyncing ?? true;
  this.showRemoveAtsignOption = showRemoveAtsignOption;

    primaryColor: primaryColor,
    backgroundColor: backgroundColor,
    labelColor: labelColor,
    style: style,

  var _atSyncUIController = AtSyncUIController();
  AtSyncUI.instance.setupController(controller: _atSyncUIController);

  syncService = AtClientManager.getInstance().syncService;