nc-photos/lib/connectivity_util.dart

12 lines
290 B
Dart
Raw Normal View History

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