Skip to content

Commit

Permalink
Merge pull request #161 from aprzedecki/patch-1
Browse files Browse the repository at this point in the history
Added mustCallSuper requirement
  • Loading branch information
marcglasberg committed Jun 23, 2024
2 parents f97f0c8 + 3030231 commit 8c208ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/action_mixins.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:async';
import 'package:meta/meta.dart';
import 'package:async_redux/async_redux.dart';
import 'package:connectivity_plus/connectivity_plus.dart';

Expand Down Expand Up @@ -72,8 +73,10 @@ mixin CheckInternet<St> on ReduxAction<St> {
return await (Connectivity().checkConnectivity());
}

@mustCallSuper
@override
Future<void> before() async {
super.before();
var result = await checkConnectivity();

if (result.contains(ConnectivityResult.none))
Expand Down Expand Up @@ -148,8 +151,10 @@ mixin AbortWhenNoInternet<St> on ReduxAction<St> {
return await (Connectivity().checkConnectivity());
}

@mustCallSuper
@override
Future<void> before() async {
super.before();
var result = await checkConnectivity();
if (result.contains(ConnectivityResult.none)) throw AbortDispatchException();
}
Expand Down

0 comments on commit 8c208ee

Please sign in to comment.