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 {
6565class _GFToastState extends State <GFToast > with TickerProviderStateMixin {
6666 late AnimationController animationController, fadeAnimationController;
6767 late Animation <double > animation, fadeAnimation;
68+ Timer ? timer;
6869 bool hideToast = false ;
6970
7071 @override
@@ -85,7 +86,7 @@ class _GFToastState extends State<GFToast> with TickerProviderStateMixin {
8586 begin: 0 ,
8687 end: 1 ,
8788 ).animate (fadeAnimationController);
88- Timer (widget.duration, () {
89+ timer = Timer (widget.duration, () {
8990 if (mounted) {
9091 fadeAnimationController.forward ();
9192 }
@@ -110,6 +111,7 @@ class _GFToastState extends State<GFToast> with TickerProviderStateMixin {
110111 void dispose () {
111112 animationController.dispose ();
112113 fadeAnimationController.dispose ();
114+ timer? .cancel ();
113115 super .dispose ();
114116 }
115117
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments