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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user