isLiveBinding top-level property
bool
get
isLiveBinding
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.
Implementation
bool get isLiveBinding {
final binding = WidgetsBinding.instance;
// AutomatedTestWidgetsFlutterBinding runs inside FakeAsync and needs
// pump(duration) to advance the fake clock. All other test bindings
// (LiveTestWidgetsFlutterBinding, PreviewTestBinding, etc.) use real
// async and should call pump() without a duration.
return binding is! AutomatedTestWidgetsFlutterBinding;
}