removePreference method

void removePreference(
  1. String key
)

remove a specific preference key='all' => removing all of the sharedPreferences

Implementation

void removePreference(String key) async {
  SharedPreferences sharedPreferences = await getSharedPreferencesInstance();
  if (key == 'all') {
    sharedPreferences.clear();
  } else
    sharedPreferences.remove(key);
}