Skip to content

Commit

Permalink
[#8] Make use of async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
Thieurom committed Aug 16, 2023
1 parent c8d6ea4 commit 3ace9b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 2 additions & 3 deletions lib/utils/internet_connection_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class InternetConnectionManagerImpl extends InternetConnectionManager {
InternetConnectionChecker();

@override

Check warning on line 17 in lib/utils/internet_connection_manager.dart

View check run for this annotation

Codecov / codecov/patch

lib/utils/internet_connection_manager.dart#L17

Added line #L17 was not covered by tests
Future<bool> hasConnection() async {
return await _internetConnectionChecker.hasConnection;
}
Future<bool> hasConnection() async =>
_internetConnectionChecker.hasConnection;

Check warning on line 19 in lib/utils/internet_connection_manager.dart

View check run for this annotation

Codecov / codecov/patch

lib/utils/internet_connection_manager.dart#L19

Added line #L19 was not covered by tests
}
8 changes: 3 additions & 5 deletions lib/widgets/alert_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Future<void> showAlertDialog({
required String title,
required String message,
required List<Widget> actions,
}) {
}) async {
if (Platform.isIOS) {
return showCupertinoDialog(
await showCupertinoDialog(
context: context,
builder: (BuildContext context) => CupertinoAlertDialog(
title: Text(title),
Expand All @@ -20,7 +20,7 @@ Future<void> showAlertDialog({
),
);
} else if (Platform.isAndroid) {
return showDialog(
await showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) => AlertDialog(
Expand All @@ -33,7 +33,5 @@ Future<void> showAlertDialog({
actions: actions,
),
);
} else {
return Future(() => {});
}
}

0 comments on commit 3ace9b7

Please sign in to comment.