create static method

Future<SharedPreferencesWithCache> create({
  1. SharedPreferencesOptions sharedPreferencesOptions = const SharedPreferencesOptions(),
  2. required SharedPreferencesWithCacheOptions cacheOptions,
  3. Map<String, Object?>? cache,
})

Creates a new instance with the given options and reloads the cache from the platform data.

Implementation

static Future<SharedPreferencesWithCache> create({
  SharedPreferencesOptions sharedPreferencesOptions =
      const SharedPreferencesOptions(),
  required SharedPreferencesWithCacheOptions cacheOptions,
  Map<String, Object?>? cache,
}) async {
  final SharedPreferencesWithCache preferences =
      SharedPreferencesWithCache._create(
    sharedPreferencesOptions: sharedPreferencesOptions,
    cacheOptions: cacheOptions,
    cache: cache,
  );

  await preferences.reloadCache();

  return preferences;
}