Changed application id, fixed network address lookup in login page

This commit is contained in:
Anton Stubenbord
2022-11-02 15:30:14 +01:00
parent 3515915083
commit 2f2312d5f3
127 changed files with 662 additions and 684 deletions

View File

@@ -17,22 +17,19 @@ class ConnectivityStatusServiceImpl implements ConnectivityStatusService {
@override
Stream<bool> connectivityChanges() {
return connectivity.onConnectivityChanged
.map(_hasActiveInternetConnection)
.asBroadcastStream();
return connectivity.onConnectivityChanged.map(_hasActiveInternetConnection).asBroadcastStream();
}
@override
Future<bool> isConnectedToInternet() async {
return _hasActiveInternetConnection(
await (Connectivity().checkConnectivity()));
return _hasActiveInternetConnection(await (Connectivity().checkConnectivity()));
}
@override
Future<bool> isServerReachable(String serverAddress) async {
try {
final result = await InternetAddress.lookup(
serverAddress.replaceAll(RegExp(r"https?://"), ""));
var uri = Uri.parse(serverAddress);
final result = await InternetAddress.lookup(uri.host);
if (result.isNotEmpty && result.first.rawAddress.isNotEmpty) {
return true;
} else {