clear method

Future<bool> clear()

Clears all values in the shared preferences.

Returns a future indicating whether the operation was successful or not.

Example:

await SimpleSharedPref().clear();

Implementation

Future<bool> clear() {
  try {
    return _preferences!.clear();
  } catch (e) {
    _logException('Error while clearing shared preferences', error: e);
    return Future.value(false);
  }
}