Reputation: 9152
Trying to create a simple countdown timer animation in Flutter
.
I have used the StepTween
class along with an AnimatedController
to achieve the animation using the following:
Flutter - Create a countdown widget.
However, what I am trying to accomplish looks something like this:
I tried creating a Row
widget and adding a Text()
followed by AnimatedWidget()
. However the styling is nowhere near the expected result:
AnimatedWidget()
to match the design?AnimatedWidget()
switches to a single digit within the 0-10 region. For example instead of showing the countdown as 0:09
it is shown as 0:9
. How do I change that?Thanks!
Upvotes: 1
Views: 814
Reputation: 571
In countdown widget
child: new Text(val.toString(), style: new TextStyle(fontSize: 150.0)),
is responsible for the styling you see. Instead try removing the style or apply the theme:
child: new Text(val.toString(), style: Theme.of(context).textTheme.body1),
Upvotes: 1