FynkelTester extension
- on
Methods
-
frames(
[int count = 1]) → Future< void> -
Available on WidgetTester, provided by the FynkelTester extension
Pumpscountframes, a 60th of a second each: the world runs as on a 60 Hz display, so once a frame at its defaulttargetFrameRateof 60, every other frame at 30, and 10 times a second while a page covers it. -
game<
T extends GameObject> () → T -
Available on WidgetTester, provided by the FynkelTester extension
The game of the first FynkelView on screen, as aT: the root it shows (FynkelViewState.root), made by the game'sFynkelApporFynkelGameor given to the view, whatever type that was made for; for a view of a world, itsFynkelGame's. Throws a StateError when there's no view, or its game isn't aT. -
loaded(
[GameObject? object, Duration timeout = const Duration(seconds: 30)]) → Future< void> -
Available on WidgetTester, provided by the FynkelTester extension
Waits untilobject(the game on screen unless given) has loaded what itsonLoadloads, and everything added then, and throws its load's error if it failed:await tester.loaded(). The files are read in real time, which a widget test's frames don't move, so it waits a little in real time and pumps a frame, over and over: the game runs meanwhile, as it would. Throws a TimeoutException aftertimeoutof real time. -
run(
double seconds) → Future< void> -
Available on WidgetTester, provided by the FynkelTester extension
Pumpssecondsof frames, 60 a second, rounded asworld.runrounds them. -
until(
bool condition(), {Duration timeout = const Duration(seconds: 30)}) → Future< void> -
Available on WidgetTester, provided by the FynkelTester extension
Runs the game untilconditionholds, 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 aftertimeoutof real time.