ReplicatorConfiguration constructor
ReplicatorConfiguration({
- required Database database,
- required Endpoint target,
- ReplicatorType replicatorType = ReplicatorType.pushAndPull,
- bool continuous = false,
- Authenticator? authenticator,
- Uint8List? pinnedServerCertificate,
- Uint8List? trustedRootCertificates,
- Map<
String, String> ? headers, - List<
String> ? channels, - List<
String> ? documentIds, - ReplicationFilter? pushFilter,
- TypedReplicationFilter? typedPushFilter,
- ReplicationFilter? pullFilter,
- TypedReplicationFilter? typedPullFilter,
- ConflictResolver? conflictResolver,
- TypedConflictResolver? typedConflictResolver,
- bool enableAutoPurge = true,
- Duration? heartbeat,
- int? maxAttempts,
- Duration? maxAttemptWaitTime,
Creates a configuration for a Replicator.
Implementation
ReplicatorConfiguration({
required this.database,
required this.target,
this.replicatorType = ReplicatorType.pushAndPull,
this.continuous = false,
this.authenticator,
this.pinnedServerCertificate,
this.trustedRootCertificates,
this.headers,
this.channels,
this.documentIds,
this.pushFilter,
this.typedPushFilter,
this.pullFilter,
this.typedPullFilter,
this.conflictResolver,
this.typedConflictResolver,
this.enableAutoPurge = true,
Duration? heartbeat,
int? maxAttempts,
Duration? maxAttemptWaitTime,
}) {
this
..heartbeat = heartbeat
..maxAttempts = maxAttempts
..maxAttemptWaitTime = maxAttemptWaitTime;
if (typedPushFilter != null ||
typedPullFilter != null ||
typedConflictResolver != null) {
(database as DatabaseBase).useWithTypedData();
}
}