Skip to content

Commit b43a74b

Browse files
committed
Merge branch 'animation_test' of https://github.com/deepikahr/getflutter into animation_test
2 parents bdf47ca + 43a4a04 commit b43a74b

File tree

3 files changed

+3
-167
lines changed

3 files changed

+3
-167
lines changed

lib/components/toast/gf_toast.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class GFToast extends StatefulWidget {
6565
class _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

test/progress_bar_test.dart

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/toast_test.dart

Lines changed: 0 additions & 165 deletions
This file was deleted.

0 commit comments

Comments
 (0)