mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +01:00
Remove obsolete code
This commit is contained in:
parent
4839d5b0bb
commit
94e7c82709
1 changed files with 0 additions and 21 deletions
|
@ -1,6 +1,4 @@
|
|||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:nc_photos/async_util.dart' as async_util;
|
||||
import 'package:nc_photos/platform/k.dart' as platform_k;
|
||||
|
||||
Future<bool> isWifi() async {
|
||||
|
@ -12,22 +10,3 @@ Future<bool> isWifi() async {
|
|||
final result = await Connectivity().checkConnectivity();
|
||||
return result == ConnectivityResult.wifi;
|
||||
}
|
||||
|
||||
Future<void> waitUntilWifi({VoidCallback? onNoWifi}) async {
|
||||
if (platform_k.isWeb) {
|
||||
// connectivity does NOT work on web, currently it will always return mobile
|
||||
// on Blink, and none on Gecko
|
||||
return;
|
||||
}
|
||||
await async_util.wait(
|
||||
() async {
|
||||
final result = await Connectivity().checkConnectivity();
|
||||
if (result == ConnectivityResult.wifi) {
|
||||
return true;
|
||||
}
|
||||
onNoWifi?.call();
|
||||
return false;
|
||||
},
|
||||
pollInterval: const Duration(seconds: 5),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue