init static method

Future<void> init()

Initializes shared preferences instance.

Implementation

static Future<void> init() async {
  _prefs = await SharedPreferences.getInstance();

  /// Reloads the shared preferences instance in the case modifications
  /// were made in the native code, after a notification action.
  _fgbgSubscription =
      FGBGEvents.instance.stream.listen((event) => _prefs.reload());

  _initialized = true;
}