nc-photos/app/lib/connectivity_util.dart
2023-08-27 19:00:36 +08:00

12 lines
433 B
Dart

import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:np_platform_util/np_platform_util.dart';
Future<bool> isWifi() async {
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;
}