ReplicatorConfiguration constructor

ReplicatorConfiguration({
  1. required Database database,
  2. required Endpoint target,
  3. ReplicatorType replicatorType = ReplicatorType.pushAndPull,
  4. bool continuous = false,
  5. Authenticator? authenticator,
  6. Uint8List? pinnedServerCertificate,
  7. Uint8List? trustedRootCertificates,
  8. Map<String, String>? headers,
  9. List<String>? channels,
  10. List<String>? documentIds,
  11. ReplicationFilter? pushFilter,
  12. TypedReplicationFilter? typedPushFilter,
  13. ReplicationFilter? pullFilter,
  14. TypedReplicationFilter? typedPullFilter,
  15. ConflictResolver? conflictResolver,
  16. TypedConflictResolver? typedConflictResolver,
  17. bool enableAutoPurge = true,
  18. Duration? heartbeat,
  19. int? maxAttempts,
  20. 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();
  }
}