readAll method

  1. @override
Future<Map<String, String>> readAll()

Reads and returns all key-value pairs from storage.

Only string values are included. Keys with non-string values are ignored.

Implementation

@override
Future<Map<String, String>> readAll() async {
  final keys = await _prefs.getKeys();
  final result = <String, String>{};
  for (final k in keys) {
    final v = await _prefs.getString(k);
    if (v != null) result[k] = v;
  }
  return result;
}