writePreferences static method
Persists preferences for the provided options.
Implementation
static Future<void> writePreferences(
SharedPreferencesPlusOptions options,
Map<String, Object?> preferences,
) async {
final file = await _getDbFile(options);
if (file == null) {
throw Exception('Failed to get database file');
}
if (!file.existsSync()) {
await file.create(recursive: true);
}
await file.writeAsString(jsonEncode(preferences));
}