1
0
Fork 0
mirror of https://gitlab.com/nkming2/nc-photos.git synced 2025-03-10 17:28:56 +01:00
nc-photos/app/lib/async_util.dart

11 lines
233 B
Dart
Raw Normal View History

2021-11-19 14:46:07 +01:00
import 'dart:async';
Future<void> wait(
FutureOr<bool> Function() condition, {
Duration? pollInterval,
}) async {
while (!await condition()) {
await Future.delayed(pollInterval ?? const Duration(milliseconds: 500));
}
}