tester/binding_aware_pump library
Properties
- isLiveBinding → bool
-
Whether the current test binding uses real async (e.g. LiveTestWidgetsFlutterBinding,
PreviewTestBinding). When true,
pump()without a duration should be used so frames render immediately and real async work progresses naturally. When false (AutomatedTestWidgetsFlutterBinding),pump(duration)should be used to advance the fake clock and fire pending timers.no setter
Functions
-
bindingAwarePump(
WidgetTester tester, {Duration interval = const Duration(milliseconds: 100)}) → Future< void> - Pumps the tester in a way that works correctly in both AutomatedTestWidgetsFlutterBinding (fake async) and live/preview bindings (real async).
-
drainAndRethrowException(
WidgetTester tester) → void -
Drains any pending exception from
tester.takeExceptionand rethrows it. This surfaces stray async errors (e.g. unhandled MissingPluginException) early, preventing them from silently corrupting test state — especially important in PreviewTestBinding where unhandled errors can prematurely complete the test. -
pumpForDuration(
WidgetTester tester, {required Duration duration, Duration step = const Duration(milliseconds: 100)}) → Future< void> -
Pumps for a total
duration, advancing time in steps ofstep. -
pumpUntilNotFound(
WidgetTester tester, Finder finder, {Duration timeout = const Duration(seconds: 10), Duration step = const Duration(milliseconds: 50)}) → Future< void> -
Pumps in a loop until
finderis no longer found.