DataSourceConfig constructor

DataSourceConfig({
  1. bool? useReport,
  2. bool? evaluationReasons,
  3. ConnectionMode? initialConnectionMode,
  4. PollingConfig? polling,
})

useReport determines if the data source will attempt to use the REPORT http method if possible. For streaming requests on the web platform report is not supported. The default value is false.

evaluationReasons determines if the evaluation reasons should be included for flag evaluations. Flags which require reasons, such as those which are part of an experiment, are not affected by this option. The default value is false.

initialConnectionMode determines the mode to use for connections when the SDK is initialized. The default is ConnectionMode.streaming. If the mode is set to ConnectionMode.offline then the data source will not request data from LaunchDarkly, but the sending of events will be unaffected. In order to completely disable network activity use LDConfig.offline.

Implementation

DataSourceConfig(
    {bool? useReport,
    bool? evaluationReasons,
    ConnectionMode? initialConnectionMode,
    PollingConfig? polling})
    : useReport =
          useReport ?? DefaultConfig.dataSourceConfig.defaultUseReport,
      evaluationReasons = evaluationReasons ??
          DefaultConfig.dataSourceConfig.defaultWithReasons,
      initialConnectionMode = initialConnectionMode ??
          DefaultConfig.dataSourceConfig.defaultInitialConnectionMode,
      polling = polling ?? PollingConfig();