File tree Expand file tree Collapse file tree 3 files changed +3
-167
lines changed Expand file tree Collapse file tree 3 files changed +3
-167
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ class GFToast extends StatefulWidget {
65
65
class _GFToastState extends State <GFToast > with TickerProviderStateMixin {
66
66
late AnimationController animationController, fadeAnimationController;
67
67
late Animation <double > animation, fadeAnimation;
68
+ Timer ? timer;
68
69
bool hideToast = false ;
69
70
70
71
@override
@@ -85,7 +86,7 @@ class _GFToastState extends State<GFToast> with TickerProviderStateMixin {
85
86
begin: 0 ,
86
87
end: 1 ,
87
88
).animate (fadeAnimationController);
88
- Timer (widget.duration, () {
89
+ timer = Timer (widget.duration, () {
89
90
if (mounted) {
90
91
fadeAnimationController.forward ();
91
92
}
@@ -110,6 +111,7 @@ class _GFToastState extends State<GFToast> with TickerProviderStateMixin {
110
111
void dispose () {
111
112
animationController.dispose ();
112
113
fadeAnimationController.dispose ();
114
+ timer? .cancel ();
113
115
super .dispose ();
114
116
}
115
117
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments