clear method Null safety

Future<bool> clear()

Implementation

Future<bool> clear() async {
  // Get SharedPreferences ref
  final SharedPreferences ref = await preferences;
  // Clear all data
  return ref.clear();
}