1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-09 06:18:49 +00:00

Add unawaited_futures (#1148)

This commit is contained in:
Brett Morgan
2022-04-27 09:24:19 +10:00
committed by GitHub
parent 802026f4ea
commit f998c9577e
12 changed files with 26 additions and 23 deletions

View File

@@ -372,7 +372,7 @@ class _ControlledAnimationState<T> extends State<ControlledAnimation>
await Future.delayed(widget.delay!);
}
_waitForDelay = false;
executeInstruction();
await executeInstruction();
}
@override
@@ -391,23 +391,23 @@ class _ControlledAnimationState<T> extends State<ControlledAnimation>
_controller.stop();
}
if (widget.playback == Playback.PLAY_FORWARD) {
_controller.forward();
await _controller.forward();
}
if (widget.playback == Playback.PLAY_REVERSE) {
_controller.reverse();
await _controller.reverse();
}
if (widget.playback == Playback.START_OVER_FORWARD) {
_controller.forward(from: 0.0);
await _controller.forward(from: 0.0);
}
if (widget.playback == Playback.START_OVER_REVERSE) {
_controller.reverse(from: 1.0);
await _controller.reverse(from: 1.0);
}
if (widget.playback == Playback.LOOP) {
_controller.repeat();
await _controller.repeat();
}
if (widget.playback == Playback.MIRROR && !_isCurrentlyMirroring) {
_isCurrentlyMirroring = true;
_controller.repeat(reverse: true);
await _controller.repeat(reverse: true);
}
if (widget.playback != Playback.MIRROR) {