Add WidgetTester.hasRunningAnimation (#8886)

Fixes #4017
This commit is contained in:
Adam Barth
2017-03-20 13:32:00 -07:00
committed by GitHub
parent 9c8763368f
commit 142922deb4
2 changed files with 22 additions and 1 deletions

View File

@@ -222,10 +222,15 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker
do {
await binding.pump(duration, phase);
count += 1;
} while (binding.transientCallbackCount > 0);
} while (hasRunningAnimations);
}).then<int>((Null _) => count);
}
/// Whether ther are any any transient callbacks scheduled.
///
/// This essentially checks whether all animations have completed.
bool get hasRunningAnimations => binding.transientCallbackCount > 0;
@override
HitTestResult hitTestOnBinding(Point location) {
location = binding.localToGlobal(location);