-
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
90063fa
commit 20c8882
Showing
5 changed files
with
70 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
name: Publish to App Store Connect | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
on: push | ||
|
||
jobs: | ||
ios_deploy: | ||
|
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,30 +1,35 @@ | ||
import 'dart:io'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
|
||
import '../apis/network/urls.dart'; | ||
import '../errors/app_error.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); | ||
} | ||
|
||
// This method is used to check internet connection | ||
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; | ||
} | ||
return false; | ||
} | ||
|
||
// This method is used to check internet connection and throw an exception if there is no internet connection | ||
Future<void> checkInternetAccess() async { | ||
try { | ||
final result = await InternetAddress.lookup('example.com'); | ||
if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) { | ||
return; // Internet access | ||
} | ||
} on SocketException catch (_) { | ||
throw NoConnectionError(); | ||
} | ||
throw NoConnectionError(); | ||
} | ||
} |