From f98d66d5142032120c7b88b0c3c7a8310e5e3545 Mon Sep 17 00:00:00 2001 From: Harun Madanoglu <60957899+yuhamadan@users.noreply.github.com> Date: Fri, 21 Feb 2020 17:38:57 +0100 Subject: [PATCH] Fix - text on MaterialButton not changing (#324) --- animations/lib/src/basics/06_custom_tween.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/animations/lib/src/basics/06_custom_tween.dart b/animations/lib/src/basics/06_custom_tween.dart index 8bd56b354..c0c9f10a5 100644 --- a/animations/lib/src/basics/06_custom_tween.dart +++ b/animations/lib/src/basics/06_custom_tween.dart @@ -52,9 +52,13 @@ class _CustomTweenDemoState extends State textColor: Colors.white, onPressed: () { if (controller.status == AnimationStatus.completed) { - controller.reverse(); + controller.reverse().whenComplete(() { + setState(() {}); + }); } else { - controller.forward(); + controller.forward().whenComplete(() { + setState(() {}); + }); } }, ),