SyncConfig constructor
const
SyncConfig({
- String? baseUrl,
- String? authToken,
- Duration syncInterval = const Duration(minutes: 5),
- int maxRetries = 3,
- bool enableAutoSync = true,
- SyncBackendAdapter? customBackendAdapter,
- ConflictStrategy conflictStrategy = ConflictStrategy.lastWriteWins,
- CustomConflictResolverCallback? customConflictResolver,
- List<
String> collections = const [], - Map<
String, SyncFilter> syncFilters = const {}, - 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',
);