readPreferences static method
Reads stored preferences for the provided options.
Implementation
static Future<Map<String, Object?>> readPreferences(SharedPreferencesPlusOptions options) async {
final file = await _getDbFile(options);
if (file == null || !file.existsSync()) {
return {};
}
final contents = await file.readAsString();
if (contents.isEmpty) {
return {};
}
return jsonDecode(contents) as Map<String, Object?>;
}