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,
  30. Set<String>? excludedSyncUserIds,
  31. bool? detectRemoteDeletions,
  32. bool? enableQueryCache,
  33. bool? enableMetadataHashCache,
  34. bool? enableDeltaSync,
  35. Duration? deltaSyncOverlap,
  36. int? maxQueryCacheSize,
  37. int? maxRelationshipQueryCacheSize,
  38. int? maxEntityExistenceCacheSize,
  39. bool? useIsolateSync,
  40. DatumSchema<E>? schema,
  41. bool? autoMigrate,
  42. bool? autoMigrateDropColumns,
})

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,
  Set<String>? excludedSyncUserIds,
  bool? detectRemoteDeletions,
  bool? enableQueryCache,
  bool? enableMetadataHashCache,
  bool? enableDeltaSync,
  Duration? deltaSyncOverlap,
  int? maxQueryCacheSize,
  int? maxRelationshipQueryCacheSize,
  int? maxEntityExistenceCacheSize,
  bool? useIsolateSync,
  DatumSchema<E>? schema,
  bool? autoMigrate,
  bool? autoMigrateDropColumns,
}) {
  return DatumConfig<E>(
    autoSyncInterval: autoSyncInterval ?? this.autoSyncInterval,
    autoStartSync: autoStartSync ?? this.autoStartSync,
    syncTimeout: syncTimeout ?? this.syncTimeout,
    // Preserve the resolver across the generic boundary. Because generics are
    // invariant, a `DatumConflictResolver<T>` (e.g. a global
    // `<DatumEntityInterface>` default) is not directly a
    // `DatumConflictResolver<E>`; rather than dropping it to null (the old
    // bug), wrap it in a [TypeAdaptedConflictResolver] when the types differ.
    defaultConflictResolver: defaultConflictResolver ?? _adaptResolver<E>(),
    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,
    excludedSyncUserIds: excludedSyncUserIds ?? this.excludedSyncUserIds,
    detectRemoteDeletions: detectRemoteDeletions ?? this.detectRemoteDeletions,
    enableQueryCache: enableQueryCache ?? this.enableQueryCache,
    enableMetadataHashCache: enableMetadataHashCache ?? this.enableMetadataHashCache,
    enableDeltaSync: enableDeltaSync ?? this.enableDeltaSync,
    deltaSyncOverlap: deltaSyncOverlap ?? this.deltaSyncOverlap,
    maxQueryCacheSize: maxQueryCacheSize ?? this.maxQueryCacheSize,
    maxRelationshipQueryCacheSize: maxRelationshipQueryCacheSize ?? this.maxRelationshipQueryCacheSize,
    maxEntityExistenceCacheSize: maxEntityExistenceCacheSize ?? this.maxEntityExistenceCacheSize,
    useIsolateSync: useIsolateSync ?? this.useIsolateSync,
    schema: schema ?? (this.schema is DatumSchema<E> ? this.schema as DatumSchema<E> : null),
    autoMigrate: autoMigrate ?? this.autoMigrate,
    autoMigrateDropColumns: autoMigrateDropColumns ?? this.autoMigrateDropColumns,
  );
}