clear method

Future<bool> clear()

Completes with true once the user preferences for the app has been cleared.


Future<bool> clear() {
  if (_prefixHasBeenChanged) {
    try {
      return _store.clearWithParameters(
          filter: PreferencesFilter(
            prefix: _prefix,
            allowList: _allowList,
    } catch (e) {
      // Catching and clarifying UnimplementedError to provide a more robust message.
      if (e is UnimplementedError) {
        throw UnimplementedError('''
This implementation of Shared Preferences doesn't yet support the setPrefix method.
Either update the implementation to support setPrefix, or do not call setPrefix.
      } else {
  return _store.clear();