nc-photos/app/lib/connectivity_util.dart

13 lines
416 B
Dart
Raw Normal View History

import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:nc_photos/platform/k.dart' as platform_k;
2021-04-10 06:28:12 +02:00
Future<bool> isWifi() async {
if (platform_k.isWeb) {
// 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;
}