FeatureHubConfig constructor

FeatureHubConfig(
  1. String host,
  2. List<String> _apiKeys,
  3. ClientFeatureRepository _repository, {
  4. int timeout = 360,
})

Implementation

FeatureHubConfig(String host, this._apiKeys, this._repository, { int timeout = 360 })
    : _api = FeatureServiceApi(ApiClient(basePath: host)),
      _timeoutInSeconds = timeout,
      _cacheTimeout = DateTime.now().subtract(Duration(seconds: 1)) // allow for immediate polling
{
  if (_apiKeys.any((key) => key.contains('*'))) {
    throw Exception(
        'You are using a client evaluated API Key in Dart and this is not supported.');
  }

  _repository.clientContext.registerChangeHandler((header) async {
    xFeatureHubHeader = header;
  });
}