initialize method

Future<void> initialize([
  1. FutureOr<SharedPreferences>? preferences
])

Initializes the NotifiedPreferences. This method should be called in your main method, before runApp.

You can pass a custom SharedPreferences instance, in case you are using another library that wraps it.

Implementation

Future<void> initialize([FutureOr<SharedPreferences>? preferences]) async =>
    _prefs ??= await (preferences ?? SharedPreferences.getInstance());