whenStopped method
Completes in the frame controller stops in, or is null if it has.
Implementation
@protected
Future<void>? whenStopped(AnimationController controller) {
if (!controller.isAnimating) {
return null;
}
final stopped = Completer<void>.sync();
void handleStatus(AnimationStatus status) {
if (status.isAnimating) {
return;
}
controller.removeStatusListener(handleStatus);
stopped.complete();
}
controller.addStatusListener(handleStatus);
return stopped.future;
}