A framework for building convergent cross-platform Nextcloud clients using Flutter.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

34 lines
1.1 KiB

part of '../neon.dart';
class Storage extends SettingsStorage {
Storage(
this._id,
this._sharedPreferences,
);
final String _id;
final SharedPreferences _sharedPreferences;
String _formatKey(final String key) => '$_id-$key';
bool containsKey(final String key) => _sharedPreferences.containsKey(_formatKey(key));
Future<bool> remove(final String key) => _sharedPreferences.remove(_formatKey(key));
@override
String? getString(final String key) => _sharedPreferences.getString(_formatKey(key));
@override
Future setString(final String key, final String value) => _sharedPreferences.setString(_formatKey(key), value);
@override
bool? getBool(final String key) => _sharedPreferences.getBool(_formatKey(key));
@override
Future setBool(final String key, final bool value) => _sharedPreferences.setBool(_formatKey(key), value);
List<String>? getStringList(final String key) => _sharedPreferences.getStringList(_formatKey(key));
Future setStringList(final String key, final List<String> value) =>
_sharedPreferences.setStringList(_formatKey(key), value);
}