SyncConfig constructor

const SyncConfig({
  1. String? baseUrl,
  2. String? authToken,
  3. Duration syncInterval = const Duration(minutes: 5),
  4. int maxRetries = 3,
  5. bool enableAutoSync = true,
  6. SyncBackendAdapter? customBackendAdapter,
  7. ConflictStrategy conflictStrategy = ConflictStrategy.lastWriteWins,
  8. CustomConflictResolverCallback? customConflictResolver,
  9. List<String> collections = const [],
  10. Map<String, SyncFilter> syncFilters = const {},
  11. EncryptionConfig encryption = const EncryptionConfig.disabled(),
})

Implementation

const SyncConfig({
  this.baseUrl,
  this.authToken,
  this.syncInterval = const Duration(minutes: 5),
  this.maxRetries = 3,
  this.enableAutoSync = true,
  this.customBackendAdapter,
  this.conflictStrategy = ConflictStrategy.lastWriteWins,
  this.customConflictResolver,
  this.collections = const [],
  this.syncFilters = const {},
  this.encryption = const EncryptionConfig.disabled(),
})  : assert(
        baseUrl != null || customBackendAdapter != null,
        'Either baseUrl or customBackendAdapter must be provided',
      ),
      assert(
        conflictStrategy != ConflictStrategy.custom ||
            customConflictResolver != null,
        'customConflictResolver is required when conflictStrategy is custom',
      );