1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-10 14:58:34 +00:00

next_gen_ui_demo: Dispose of old AnimationControllers (#1852)

This commit is contained in:
Brett Morgan
2023-05-30 12:15:45 +10:00
committed by GitHub
parent 7100438182
commit 6c31477626
7 changed files with 67 additions and 12 deletions

View File

@@ -261,7 +261,15 @@ class _StartBtnState extends State<_StartBtn> {
),
],
)
.animate(autoPlay: false, onInit: (c) => _btnAnim = c)
.animate(
autoPlay: false,
onInit: (c) {
if (_btnAnim != null && _btnAnim != c) {
_btnAnim?.dispose();
}
_btnAnim = c;
},
)
.shimmer(duration: .7.seconds, color: Colors.black),
)
.animate()