reset static method

Future<void> reset({
  1. dynamic customCriteriaKeys = const [],
})

Resets all flags in the system's shared preferences. Basically this is like taking the app in terms of this packag, to the state it was when the app was first installed and launched.

Implementation

static Future<void> reset({customCriteriaKeys = const []}) async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  await prefs.remove(prefTimesLaunched);
  await prefs.remove(prefLastReturnedTrue);
  await prefs.remove(prefShouldReview);
  await prefs.remove(prefFirstLaunchDate);
  await prefs.remove(prefInDaysCoolDownMode);
  await prefs.remove(prefInTimesLaunchedCoolDownMode);

  customCriteriaKeys.forEach((key) async {
    await prefs.remove(prefCustomCriteriaPrefix + key);
    await prefs.remove(prefInCustomCoolDownModePrefix + key);
  });
}