copyWith method

Settings copyWith(
  1. {bool? persistenceEnabled,
  2. String? host,
  3. bool? sslEnabled,
  4. int? cacheSizeBytes,
  5. bool? webExperimentalForceLongPolling,
  6. bool? webExperimentalAutoDetectLongPolling,
  7. bool? ignoreUndefinedProperties,
  8. WebExperimentalLongPollingOptions? webExperimentalLongPollingOptions}
)

Creates a copy with modified fields.

Parameters: Optional parameters to override.

Returns: A new Settings instance.

Implementation

Settings copyWith({
  bool? persistenceEnabled,
  String? host,
  bool? sslEnabled,
  int? cacheSizeBytes,
  bool? webExperimentalForceLongPolling,
  bool? webExperimentalAutoDetectLongPolling,
  bool? ignoreUndefinedProperties,
  WebExperimentalLongPollingOptions? webExperimentalLongPollingOptions,
}) {
  assert(cacheSizeBytes == null || cacheSizeBytes > 0,'Offline persistence is not supported.');
  return Settings(
    persistenceEnabled: persistenceEnabled ?? this.persistenceEnabled,
    host: host ?? this.host,
    sslEnabled: sslEnabled ?? this.sslEnabled,
    cacheSizeBytes: cacheSizeBytes ?? this.cacheSizeBytes,
    webExperimentalForceLongPolling: webExperimentalForceLongPolling ?? this.webExperimentalForceLongPolling,
    webExperimentalAutoDetectLongPolling: webExperimentalAutoDetectLongPolling ?? this.webExperimentalAutoDetectLongPolling,
    webExperimentalLongPollingOptions: webExperimentalLongPollingOptions ?? this.webExperimentalLongPollingOptions,
    ignoreUndefinedProperties: ignoreUndefinedProperties ?? this.ignoreUndefinedProperties,
  );
}