From ebb57efde7dacefe307b8f3b7cf617a7610a646f Mon Sep 17 00:00:00 2001 From: Petrus Nguyen Thai Hoc Date: Fri, 30 Apr 2021 18:35:32 +0700 Subject: [PATCH] prepare 2.0.0 --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ lib/src/interface/extensions.dart | 7 +++++++ pubspec.lock | 2 +- pubspec.yaml | 1 + 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dedce31..874ab47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,33 @@ +## 2.0.0 - Apr 30, 2021 + +- Stable release for null safety. + +- Refactor based on [rx_storage: 1.0.0](https://pub.dev/packages/rx_storage/versions/1.0.0) package: + - Stable release for null safety. + + - Add [RxStorage.executeUpdate`](https://pub.dev/documentation/rx_storage/latest/rx_storage/RxStorage/executeUpdate.html): Read–modify–write style. + + - Synchronize writing task by key. + + - Internal refactoring, optimize performance. + +- Add more extensions: + - `getObject`: reads a value of any type from persistent storage. + + - `getObjectStream`: observe a Stream of any type from persistent storage. + + - `executeUpdateBool`: based on [RxStorage.executeUpdate`](https://pub.dev/documentation/rx_storage/latest/rx_storage/RxStorage/executeUpdate.html). + + - `executeUpdateDouble`: based on [RxStorage.executeUpdate`](https://pub.dev/documentation/rx_storage/latest/rx_storage/RxStorage/executeUpdate.html). + + - `executeUpdateInt`: based on [RxStorage.executeUpdate`](https://pub.dev/documentation/rx_storage/latest/rx_storage/RxStorage/executeUpdate.html). + + - `executeUpdateString`: based on [RxStorage.executeUpdate`](https://pub.dev/documentation/rx_storage/latest/rx_storage/RxStorage/executeUpdate.html). + + - `executeUpdateStringList`: based on [RxStorage.executeUpdate`](https://pub.dev/documentation/rx_storage/latest/rx_storage/RxStorage/executeUpdate.html). + +- Update docs. + ## 2.0.0-nullsafety.0 - Feb 24, 2021 * **Breaking** diff --git a/lib/src/interface/extensions.dart b/lib/src/interface/extensions.dart index c612dc9..fe3be37 100644 --- a/lib/src/interface/extensions.dart +++ b/lib/src/interface/extensions.dart @@ -1,3 +1,5 @@ +import 'package:meta/meta.dart'; + import '../../rx_shared_preferences.dart'; T _identity(T t) => t; @@ -109,6 +111,7 @@ extension RxSharedPreferencesExtension on RxSharedPreferences { /// /// Read bool value by [key], than transform value by [transformer] /// and finally save computed value to persistent storage. + @experimental Future executeUpdateBool(String key, Transformer transformer) => executeUpdate(key, _cast, transformer, _identity); @@ -116,6 +119,7 @@ extension RxSharedPreferencesExtension on RxSharedPreferences { /// /// Read double value by [key], than transform value by [transformer] /// and finally save computed value to persistent storage. + @experimental Future executeUpdateDouble( String key, Transformer transformer) => executeUpdate(key, _cast, transformer, _identity); @@ -124,6 +128,7 @@ extension RxSharedPreferencesExtension on RxSharedPreferences { /// /// Read int value by [key], than transform value by [transformer] /// and finally save computed value to persistent storage. + @experimental Future executeUpdateInt(String key, Transformer transformer) => executeUpdate(key, _cast, transformer, _identity); @@ -131,6 +136,7 @@ extension RxSharedPreferencesExtension on RxSharedPreferences { /// /// Read String value by [key], than transform value by [transformer] /// and finally save computed value to persistent storage. + @experimental Future executeUpdateString( String key, Transformer transformer) => executeUpdate(key, _cast, transformer, _identity); @@ -139,6 +145,7 @@ extension RxSharedPreferencesExtension on RxSharedPreferences { /// /// Read List value by [key], than transform value by [transformer] /// and finally save computed value to persistent storage. + @experimental Future executeUpdateStringList( String key, Transformer?> transformer) => executeUpdate>(key, _cast, transformer, _identity); diff --git a/pubspec.lock b/pubspec.lock index d4c06ba..613478e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -101,7 +101,7 @@ packages: source: hosted version: "0.12.10" meta: - dependency: transitive + dependency: "direct main" description: name: meta url: "https://pub.dartlang.org" diff --git a/pubspec.yaml b/pubspec.yaml index 76abe46..b7792aa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,6 +14,7 @@ dependencies: sdk: flutter shared_preferences: ^2.0.5 rx_storage: ^1.0.0 + meta: ^1.3.0 dev_dependencies: flutter_test: