clear method

Future<void> clear({
  1. Set<String>? allowList,
})

Clears all preferences from the platform.

If no parameters are provided, and SharedPreferencesAsync has no filter, all preferences will be removed. This may include values not set by this instance, such as those stored by native code or by other packages using shared_preferences internally, which may cause unintended side effects.

It is highly recommended that an allowList be provided to this call.

Implementation

Future<void> clear({Set<String>? allowList}) {
  final ClearPreferencesParameters parameters = ClearPreferencesParameters(
      filter: PreferencesFilters(allowList: allowList));
  return _platform.clear(parameters, _options);
}