enableSync method

void enableSync({
  1. required UiGraphTransport transport,
  2. required Future<String?> getAppUserId(),
  3. required String sdkName,
  4. required String sdkVersion,
  5. required String platform,
  6. required String appVersion(),
})

Attach the uploader.

Implementation

void enableSync({
  required UiGraphTransport transport,
  required Future<String?> Function() getAppUserId,
  required String sdkName,
  required String sdkVersion,
  required String platform,
  required String Function() appVersion,
}) {
  if (_sync != null) return;
  _sync = UiGraphSyncEngine(
    host: this,
    transport: transport,
    getAppUserId: getAppUserId,
    sdkName: sdkName,
    sdkVersion: sdkVersion,
    platform: platform,
    appVersion: appVersion,
    isEnabled: () => ActionGates.instance.cacheSyncEnabled,
    generation: () => _epoch,
    now: _now,
  )..start();
}