until method

Future<void> until(
  1. bool condition(), {
  2. Duration timeout = const Duration(seconds: 30),
})

Runs the game until condition holds, as loaded does: a little real time for files to be read, then a frame, over and over. For what loaded can't be given, as a level a button makes inside the game: await tester.until(() => game.level == 2). Throws a TimeoutException after timeout of real time.

Implementation

Future<void> until(bool Function() condition, {Duration timeout = const Duration(seconds: 30)}) =>
    _until(condition, timeout, () => 'what until waited for was not so after ${timeout.inMilliseconds} ms');