Update: 2026-06-24 16:19:03
This commit is contained in:
@@ -64,6 +64,7 @@ class _SnackContent extends StatefulWidget {
|
|||||||
class _SnackContentState extends State<_SnackContent>
|
class _SnackContentState extends State<_SnackContent>
|
||||||
with TickerProviderStateMixin {
|
with TickerProviderStateMixin {
|
||||||
late final AnimationController _ctrl;
|
late final AnimationController _ctrl;
|
||||||
|
late final AnimationController _scaleCtrl;
|
||||||
late final Animation<double> _scaleAnim;
|
late final Animation<double> _scaleAnim;
|
||||||
late final Animation<double> _progressAnim;
|
late final Animation<double> _progressAnim;
|
||||||
|
|
||||||
@@ -74,11 +75,13 @@ class _SnackContentState extends State<_SnackContent>
|
|||||||
super.initState();
|
super.initState();
|
||||||
_ctrl = AnimationController(vsync: this, duration: _displayDuration);
|
_ctrl = AnimationController(vsync: this, duration: _displayDuration);
|
||||||
|
|
||||||
_scaleAnim = CurvedAnimation(
|
_scaleCtrl = AnimationController(
|
||||||
parent: AnimationController(
|
|
||||||
vsync: this,
|
vsync: this,
|
||||||
duration: const Duration(milliseconds: 500),
|
duration: const Duration(milliseconds: 500),
|
||||||
)..forward(),
|
);
|
||||||
|
|
||||||
|
_scaleAnim = CurvedAnimation(
|
||||||
|
parent: _scaleCtrl,
|
||||||
curve: Curves.elasticOut,
|
curve: Curves.elasticOut,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -86,12 +89,14 @@ class _SnackContentState extends State<_SnackContent>
|
|||||||
CurvedAnimation(parent: _ctrl, curve: Curves.linear),
|
CurvedAnimation(parent: _ctrl, curve: Curves.linear),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
_scaleCtrl.forward();
|
||||||
_ctrl.forward();
|
_ctrl.forward();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_ctrl.dispose();
|
_ctrl.dispose();
|
||||||
|
_scaleCtrl.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user