Here is an example:
void main(List<String> args) async {
JtPreferences.initialize("path/path");
final preferences = JtPreferences.getInstance();
await preferences.setString('token', '123');
await preferences.setInt('age', 18);
await preferences.setDouble('weight', 18.5);
await preferences.setBool('isFree', false);
await preferences.contains('isFree'); //true
await preferences.remove('isFree');
await preferences.contains('isFree'); //false
preferences.listen(key: 'token').listen((event) {
print("key $event updated");
});
preferences.listen().listen((event) {
print("key $event updated");
});
}
Libraries
- adapter/data_mapper
- adapter/decoder
- adapter/encoder
- adapter/serializer
- core/preferences
- core/read
- core/write
- encryption/decrypt
- encryption/encrypt
- encryption/encryption
- file/dir/directory_provider
- file/dir/directory_provider_impl
- file/file_manager
- file/file_manager_impl
- jt_preferences
- preferences_manager