nc-photos/lib/connectivity_util.dart

12 lines
300 B
Dart
Raw Normal View History

import 'package:connectivity_plus/connectivity_plus.dart';
2021-04-10 06:28:12 +02:00
Future<void> waitUntilWifi() async {
while (true) {
final result = await Connectivity().checkConnectivity();
if (result == ConnectivityResult.wifi) {
return;
}
await Future.delayed(const Duration(seconds: 5));
}
}