copyWith<E extends DatumEntityInterface> method

DatumConfig<E> copyWith<E extends DatumEntityInterface>({
  1. Duration? autoSyncInterval,
  2. bool? autoStartSync,
  3. Duration? syncTimeout,
  4. DatumConflictResolver<E>? defaultConflictResolver,
  5. UserSwitchStrategy? defaultUserSwitchStrategy,
  6. Future<String?> initialUserId()?,
  7. bool? enableLogging,
  8. SyncDirection? defaultSyncDirection,
  9. int? schemaVersion,
  10. List<Migration>? migrations,
  11. DatumSyncExecutionStrategy? syncExecutionStrategy,
  12. MigrationErrorHandler? onMigrationError,
  13. DatumSyncRequestStrategy? syncRequestStrategy,
  14. DatumErrorRecoveryStrategy? errorRecoveryStrategy,
  15. Duration? remoteEventDebounceTime,
  16. Duration? changeCacheDuration,
  17. DatumSyncOptions<E>? defaultSyncOptions,
  18. int? maxChangeCacheSize,
  19. Duration? changeCacheCleanupInterval,
  20. int? remoteSyncBatchSize,
  21. int? remoteStreamBatchSize,
  22. int? progressEventFrequency,
  23. LogLevel? logLevel,
  24. bool? enablePerformanceLogging,
  25. Duration? performanceLogThreshold,
  26. Map<String, LogSampler>? logSamplers,
  27. SyncDirectionResolver? syncDirectionResolver,
  28. ColdStartConfig? coldStartConfig,
  29. DeleteBehavior? deleteBehavior,
})

Implementation

DatumConfig<E> copyWith<E extends DatumEntityInterface>({
  Duration? autoSyncInterval,
  bool? autoStartSync,
  Duration? syncTimeout,
  DatumConflictResolver<E>? defaultConflictResolver,
  UserSwitchStrategy? defaultUserSwitchStrategy,
  Future<String?> Function()? initialUserId,
  bool? enableLogging,
  SyncDirection? defaultSyncDirection,
  int? schemaVersion,
  List<Migration>? migrations,
  DatumSyncExecutionStrategy? syncExecutionStrategy,
  MigrationErrorHandler? onMigrationError,
  DatumSyncRequestStrategy? syncRequestStrategy,
  DatumErrorRecoveryStrategy? errorRecoveryStrategy,
  Duration? remoteEventDebounceTime,
  Duration? changeCacheDuration,
  DatumSyncOptions<E>? defaultSyncOptions,
  int? maxChangeCacheSize,
  Duration? changeCacheCleanupInterval,
  int? remoteSyncBatchSize,
  int? remoteStreamBatchSize,
  int? progressEventFrequency,
  LogLevel? logLevel,
  bool? enablePerformanceLogging,
  Duration? performanceLogThreshold,
  Map<String, LogSampler>? logSamplers,
  SyncDirectionResolver? syncDirectionResolver,
  ColdStartConfig? coldStartConfig,
  DeleteBehavior? deleteBehavior,
}) {
  return DatumConfig<E>(
    autoSyncInterval: autoSyncInterval ?? this.autoSyncInterval,
    autoStartSync: autoStartSync ?? this.autoStartSync,
    syncTimeout: syncTimeout ?? this.syncTimeout,
    // Only copy the resolver if the new type E is assignable from the old type T.
    // This is safe when copyWith is called without a new generic type.
    // This is safe when copyWith is called without a new generic type.
    defaultConflictResolver: defaultConflictResolver ?? (this.defaultConflictResolver is DatumConflictResolver<E> ? this.defaultConflictResolver as DatumConflictResolver<E> : null),
    defaultUserSwitchStrategy: defaultUserSwitchStrategy ?? this.defaultUserSwitchStrategy,
    initialUserId: initialUserId ?? this.initialUserId,
    enableLogging: enableLogging ?? this.enableLogging,
    defaultSyncDirection: defaultSyncDirection ?? this.defaultSyncDirection,
    schemaVersion: schemaVersion ?? this.schemaVersion,
    migrations: migrations ?? this.migrations,
    syncExecutionStrategy: syncExecutionStrategy ?? this.syncExecutionStrategy,
    onMigrationError: onMigrationError ?? this.onMigrationError,
    syncRequestStrategy: syncRequestStrategy ?? this.syncRequestStrategy,
    errorRecoveryStrategy: errorRecoveryStrategy ?? this.errorRecoveryStrategy,
    remoteEventDebounceTime: remoteEventDebounceTime ?? this.remoteEventDebounceTime,
    changeCacheDuration: changeCacheDuration ?? this.changeCacheDuration,
    defaultSyncOptions: defaultSyncOptions ?? (this.defaultSyncOptions is DatumSyncOptions<E> ? this.defaultSyncOptions as DatumSyncOptions<E> : null),
    maxChangeCacheSize: maxChangeCacheSize ?? this.maxChangeCacheSize,
    changeCacheCleanupInterval: changeCacheCleanupInterval ?? this.changeCacheCleanupInterval,
    remoteSyncBatchSize: remoteSyncBatchSize ?? this.remoteSyncBatchSize,
    remoteStreamBatchSize: remoteStreamBatchSize ?? this.remoteStreamBatchSize,
    progressEventFrequency: progressEventFrequency ?? this.progressEventFrequency,
    logLevel: logLevel ?? this.logLevel,
    enablePerformanceLogging: enablePerformanceLogging ?? this.enablePerformanceLogging,
    performanceLogThreshold: performanceLogThreshold ?? this.performanceLogThreshold,
    logSamplers: logSamplers ?? this.logSamplers,
    syncDirectionResolver: syncDirectionResolver ?? this.syncDirectionResolver,
    coldStartConfig: coldStartConfig ?? this.coldStartConfig,
    deleteBehavior: deleteBehavior ?? this.deleteBehavior,
  );
}