2021-07-12 13:42:42 +02:00
|
|
|
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
|
|
|
|
2022-04-08 22:16:35 +02:00
|
|
|
Future<bool> isWifi() async {
|
2023-08-27 12:58:05 +02:00
|
|
|
if (getRawPlatform() == NpPlatform.web) {
|
2022-04-08 22:16:35 +02:00
|
|
|
// 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;
|
|
|
|
}
|