DatumConfig<T extends DatumEntityBase> class
Configuration for the Datum engine and its managers.
- Implementers
Constructors
-
DatumConfig({Duration autoSyncInterval = const Duration(minutes: 15), bool autoStartSync = false, Duration syncTimeout = const Duration(minutes: 2), DatumConflictResolver<
T> ? defaultConflictResolver, UserSwitchStrategy defaultUserSwitchStrategy = UserSwitchStrategy.syncThenSwitch, String? initialUserId, bool enableLogging = true, SyncDirection defaultSyncDirection = SyncDirection.pushThenPull, int schemaVersion = 0, List<Migration> migrations = const [], DatumSyncExecutionStrategy syncExecutionStrategy = const SequentialStrategy(), MigrationErrorHandler? onMigrationError, DatumSyncRequestStrategy syncRequestStrategy = const SequentialRequestStrategy(), DatumErrorRecoveryStrategy errorRecoveryStrategy = const DatumErrorRecoveryStrategy(shouldRetry: _defaultShouldRetry, maxRetries: 3, backoffStrategy: ExponentialBackoff()), Duration remoteEventDebounceTime = const Duration(milliseconds: 50), Duration changeCacheDuration = const Duration(seconds: 5)}) -
const
- DatumConfig.defaultConfig()
-
A default configuration with sensible production values.
factory
Properties
- autoStartSync → bool
-
Whether to automatically start auto-sync for all users with local data
upon initialization.
final
- autoSyncInterval → Duration
-
The interval for any automatic background synchronization.
final
- changeCacheDuration → Duration
-
The duration to keep a change ID in the cache to prevent duplicate processing.
final
-
defaultConflictResolver
→ DatumConflictResolver<
T> ? -
The default conflict resolver to use if none is provided per-operation.
If null, LastWriteWinsResolver is used.
final
- defaultSyncDirection → SyncDirection
-
The default direction for synchronization.
final
- defaultUserSwitchStrategy → UserSwitchStrategy
-
The default strategy to use when switching users.
final
- enableLogging → bool
-
Whether to enable detailed logging from the Datum engine.
final
- errorRecoveryStrategy → DatumErrorRecoveryStrategy
-
The strategy for handling errors and retries during synchronization.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialUserId → String?
-
The user ID to target for the initial auto-sync if autoStartSync is
true. If null, DatumManager will discover all users with local data.
final
-
migrations
→ List<
Migration> -
A list of Migration classes to be run when the schemaVersion is incremented.
final
- onMigrationError → MigrationErrorHandler?
-
A callback to handle failures during schema migration.
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- remoteEventDebounceTime → Duration
-
The duration to buffer remote changes before processing a batch.
Helps to group rapid-fire updates from a server push into a single operation.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schemaVersion → int
-
The current version of the data schema for migration purposes.
final
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited - syncExecutionStrategy → DatumSyncExecutionStrategy
-
The execution strategy for processing the sync queue.
final
- syncRequestStrategy → DatumSyncRequestStrategy
-
The strategy for handling concurrent calls to the
synchronizemethod. Defaults to SequentialRequestStrategy.final - syncTimeout → Duration
-
The maximum duration for a single sync cycle before it times out.
final
Methods
-
copyWith<
E extends DatumEntityBase> ({Duration? autoSyncInterval, bool? autoStartSync, Duration? syncTimeout, DatumConflictResolver< E> ? defaultConflictResolver, UserSwitchStrategy? defaultUserSwitchStrategy, String? initialUserId, bool? enableLogging, SyncDirection? defaultSyncDirection, int? schemaVersion, List<Migration> ? migrations, DatumSyncExecutionStrategy? syncExecutionStrategy, MigrationErrorHandler? onMigrationError, DatumSyncRequestStrategy? syncRequestStrategy, DatumErrorRecoveryStrategy? errorRecoveryStrategy, Duration? remoteEventDebounceTime, Duration? changeCacheDuration}) → DatumConfig<E> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String - A string representation of this object.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited