-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91bbbdb
commit 3bdc5fb
Showing
11 changed files
with
402 additions
and
424 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,6 +1,30 @@ | ||
import 'dart:io'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
|
||
/// | ||
Future<void> internetLookUp() async { | ||
await InternetAddress.lookup('google.com'); | ||
} | ||
import '../apis/network/urls.dart'; | ||
|
||
final connectivityHandlerProvider = Provider<ConnectivityHandler>((ref) { | ||
return ConnectivityHandler(); | ||
}); | ||
|
||
class ConnectivityHandler { | ||
Future<void> lookUpDropbox() async { | ||
await InternetAddress.lookup(BaseURL.dropboxV2); | ||
} | ||
|
||
Future<void> lookUpGoogleDrive() async { | ||
await InternetAddress.lookup(BaseURL.googleDriveV3); | ||
} | ||
|
||
Future<bool> hasInternetAccess() async { | ||
try { | ||
final result = await InternetAddress.lookup('example.com'); | ||
if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) { | ||
return true; // Internet access | ||
} | ||
} on SocketException catch (_) { | ||
return false; // No Internet access | ||
} | ||
return 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
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
Oops, something went wrong.