hasRunningAnimations property
Whether there are any transient callbacks scheduled.
This essentially checks whether all animations have completed.
See also:
- pumpAndSettle, which essentially calls pump until there are no scheduled frames.
- SchedulerBinding.transientCallbackCount, which is the value on which this is based.
- SchedulerBinding.hasScheduledFrame, which is true whenever a frame is pending. SchedulerBinding.hasScheduledFrame is made true when a widget calls State.setState, even if there are no transient callbacks scheduled. This is what pumpAndSettle uses.
Implementation
bool get hasRunningAnimations => binding.transientCallbackCount > 0;