initialize static method

Future<void> initialize({
  1. required String flavor,
  2. bool enableMockup = false,
  3. int maxCacheImage = 30,
})

Initialize the configuration.

Runs the first time the app is run.

Implementation

static Future<void> initialize({
  required String flavor,
  bool enableMockup = false,
  int maxCacheImage = 30,
}) async {
  if (isInitialized) {
    return;
  }
  _flavor = flavor;
  _isEnabledMockup = enableMockup;
  _maxCacheImage = maxCacheImage;
  await Prefs.initialize();
  if (!Prefs.containsKey(_uidKey)) {
    Prefs.set(_uidKey, _uid = uuid);
  } else {
    _uid = Prefs.getString(_uidKey);
  }
  _isInitialized = true;
}