From fa1913eff897d8d028a6b4e948b071988544495a Mon Sep 17 00:00:00 2001 From: Marcelo Glasberg <13332110+marcglasberg@users.noreply.github.com> Date: Wed, 1 May 2024 13:21:54 -0300 Subject: [PATCH] Version bump: 23.0.0 = connectivity_plus: 6.0.3 --- CHANGELOG.md | 4 ++++ README.md | 20 +------------------- lib/src/action_mixins.dart | 14 +++++++------- pubspec.yaml | 8 ++++---- 4 files changed, 16 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f848c5e..9720b00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ an on ReduxAction { bool get ifOpenDialog => true; - UserException connectionException(ConnectivityResult result) => + UserException connectionException(List result) => ConnectionException.noConnectivity; /// If you are running tests, you can override this method to simulate the internet connection @@ -65,9 +65,9 @@ mixin CheckInternet on ReduxAction { /// Return `null` to use the real internet connection status. static bool? Function() forceInternetOnOffSimulation = () => null; - Future checkConnectivity() async { + Future> checkConnectivity() async { if (internetOnOffSimulation != null) - return internetOnOffSimulation! ? ConnectivityResult.wifi : ConnectivityResult.none; + return internetOnOffSimulation! ? [ConnectivityResult.wifi] : [ConnectivityResult.none]; return await (Connectivity().checkConnectivity()); } @@ -76,7 +76,7 @@ mixin CheckInternet on ReduxAction { Future before() async { var result = await checkConnectivity(); - if (result == ConnectivityResult.none) + if (result.contains(ConnectivityResult.none)) throw connectionException(result).withDialog(ifOpenDialog); } } @@ -141,9 +141,9 @@ mixin AbortWhenNoInternet on ReduxAction { /// Return `null` to use the real internet connection status. bool? get internetOnOffSimulation => CheckInternet.forceInternetOnOffSimulation(); - Future checkConnectivity() async { + Future> checkConnectivity() async { if (internetOnOffSimulation != null) - return internetOnOffSimulation! ? ConnectivityResult.wifi : ConnectivityResult.none; + return internetOnOffSimulation! ? [ConnectivityResult.wifi] : [ConnectivityResult.none]; return await (Connectivity().checkConnectivity()); } @@ -151,7 +151,7 @@ mixin AbortWhenNoInternet on ReduxAction { @override Future before() async { var result = await checkConnectivity(); - if (result == ConnectivityResult.none) throw AbortDispatchException(); + if (result.contains(ConnectivityResult.none)) throw AbortDispatchException(); } } diff --git a/pubspec.yaml b/pubspec.yaml index 8991288..edefca1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: async_redux description: Redux state management. An optimized Redux version, which is very easy to learn and use, yet powerful and tailored for Flutter. It allows both sync and async reducers. -version: 22.5.0 +version: 23.0.0 # author: Marcelo Glasberg homepage: https://github.com/marcglasberg/async_redux topics: @@ -14,11 +14,11 @@ environment: dependencies: async_redux_core: ^1.2.0 meta: ^1.11.0 - path_provider: ^2.1.1 + path_provider: ^2.1.3 file: ^7.0.0 weak_map: ^3.0.0 - fast_immutable_collections: ^10.1.2 - connectivity_plus: ^5.0.2 + fast_immutable_collections: ^10.2.2 + connectivity_plus: ^6.0.3 collection: ^1.18.0 logging: ^1.2.0 path: ^1.8.3