Skip to content

Commit

Permalink
optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
xaldarof committed Apr 18, 2024
1 parent e5934b8 commit cd15c12
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
# 2.3.0 - Remove,Contains key methods.

# 3.0.0 - GetAll,Clear, Save object,getObject,OnConflict Strategy


# 5.0.6 - Read,Write optimization
7 changes: 3 additions & 4 deletions bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ void main(List<String> args) async {
await preferences.setDouble('weight', 18.5);
await preferences.setBool('isFree', false);

await preferences.contains('isFree'); //true
preferences.contains('isFree'); //true
await preferences.remove('isFree');
await preferences.contains('isFree'); //false
preferences.contains('isFree'); //false

//Save writable object
await preferences.saveObject(User(name: 'averageName', age: 12));

//get writable object
final object =
await preferences.getObject('averageName', (map) => User.fromJson(map));
final object = preferences.getObject('averageName', (map) => User.fromJson(map));
print(object?.name);
print(object?.age);

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: jt_preferences
description: Json based key-value storage with AES encryption support. Supported data types are `int`, `double`, `bool`, `String` and `Writable object`.
version: 4.0.6
version: 5.0.6
homepage: "https://github.com/xaldarof/jt_preferences"

environment:
Expand Down

0 comments on commit cd15c12

Please sign in to comment.