nc-photos/app/lib/connectivity_util.dart

13 lines
433 B
Dart
Raw Normal View History

import 'package:connectivity_plus/connectivity_plus.dart';
2023-08-27 12:58:05 +02:00
import 'package:np_platform_util/np_platform_util.dart';
2021-04-10 06:28:12 +02:00
Future<bool> isWifi() async {
2023-08-27 12:58:05 +02:00
if (getRawPlatform() == NpPlatform.web) {
// connectivity does NOT work on web, currently it will always return mobile
// on Blink, and none on Gecko
return true;
}
final result = await Connectivity().checkConnectivity();
return result == ConnectivityResult.wifi;
}