copyWith method
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,
);
}