initialize static method

Future<void> initialize({
  1. RemoteConfigSettings? settings,
  2. bool fetchLatest = false,
})

Initialize local cache from remote config.

Implementation

static Future<void> initialize({
  RemoteConfigSettings? settings,
  bool fetchLatest = false,
}) async {
  await Firebase.initializeApp();
  final remoteConfig = await ensureRemoteConfig(settings: settings);
  await _ensurePreferences();
  if (fetchLatest) {
    await _fetchAndActivate(remoteConfig);
  }
  if (_cacheInitialized) return;

  await _saveRemoteConfigToPreferences(remoteConfig);
  _cacheInitialized = true;
  _markUpdated();
}