-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #439 from cunarist/organize-flutter-deps
Organize Dart dependencies and introduce `rinf server` command
- Loading branch information
Showing
6 changed files
with
62 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
import 'package:internet_connection_checker/internet_connection_checker.dart'; | ||
import 'dart:io'; | ||
|
||
var isInternetConnected = false; | ||
|
||
Future<void> checkConnectivity() async { | ||
isInternetConnected = await InternetConnectionChecker().hasConnection; | ||
try { | ||
final result = await InternetAddress.lookup('pub.dev'); | ||
if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) { | ||
isInternetConnected = true; | ||
} | ||
} on SocketException catch (_) { | ||
isInternetConnected = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters