asyncredux-check-internet-mixin
Installation
SKILL.md
CheckInternet Mixin
The CheckInternet mixin verifies device connectivity before an action executes. If there's no internet connection, the action aborts and displays a dialog with the message: "There is no Internet. Please, verify your connection."
Basic Usage
class LoadText extends AppAction with CheckInternet {
Future<AppState?> reduce() async {
var response = await http.get('https://api.example.com/text');
return state.copy(text: response.body);
}
}
The mixin works by overriding the before() method. If the device lacks connectivity, it throws a UserException which triggers the standard error dialog.