Settings constructor

Settings({
  1. String host = defaultHost,
  2. int port = defaultPort,
  3. bool sslEnabled = true,
  4. bool persistenceEnabled = true,
  5. int cacheSizeBytes = defaultCacheSizeBytes,
  6. LocalCacheSettings? cacheSettings,
  7. bool webExperimentalForceLongPolling = false,
  8. bool? webExperimentalAutoDetectLongPolling,
  9. WebExperimentalLongPollingOptions webExperimentalLongPollingOptions = const WebExperimentalLongPollingOptions(),
  10. int grpcFlowControlWindow = defaultGrpcFlowControlWindow,
})

Creates settings; every argument has the default of the field of the same name.

Throws an ArgumentError when host is not a plain host name or IP address (it must not contain a scheme, user info or path), when sslEnabled is false with the production host, when cacheSizeBytes is below minimumCacheBytes (and not cacheSizeUnlimited), when both long-polling options are turned on, and for the invalid values described on webExperimentalLongPollingOptions and grpcFlowControlWindow. Throws a StateError when cacheSettings is given together with a non-default persistenceEnabled or cacheSizeBytes.

To use the emulator, call withEmulator on the result rather than passing its host here.

Implementation

Settings({
  String host = defaultHost,
  int port = defaultPort,
  bool sslEnabled = true,
  bool persistenceEnabled = true,
  int cacheSizeBytes = defaultCacheSizeBytes,
  LocalCacheSettings? cacheSettings,
  bool webExperimentalForceLongPolling = false,
  bool? webExperimentalAutoDetectLongPolling,
  WebExperimentalLongPollingOptions webExperimentalLongPollingOptions =
      const WebExperimentalLongPollingOptions(),
  int grpcFlowControlWindow = defaultGrpcFlowControlWindow,
}) : this._(
       webExperimentalForceLongPolling: webExperimentalForceLongPolling,
       experimentalAutoDetectLongPolling:
           webExperimentalAutoDetectLongPolling,
       experimentalLongPollingOptions: webExperimentalLongPollingOptions,
       grpcFlowControlWindow: grpcFlowControlWindow,
       host: host,
       port: port,
       sslEnabled: sslEnabled,
       persistenceEnabled: persistenceEnabled,
       cacheSizeBytes: cacheSizeBytes,
       cacheSettings: cacheSettings,
       emulator: false,
       mockUserToken: null,
     );