title: Flutter: Countdown timer that displays minutes and seconds
body: <p>I have created a countdown timer that will countdown from a user inputted duration, in minutes.</p>
  
  <p>The countdown timer technically works, but only the minutes are being shown counting down.  The seconds remain at :00 the entire time.  </p>
  
  <p>How can I get the seconds to also display as part of the countdown timer?</p>
  
  <p>Here is the relevant code, excerpted from a longer file.  I can include more if needed.</p>
  
  <p>The individual pieces of code are broken down as follows:</p>
  
  <p>First, I have a class that actually displays the timer text and allows it to be styled:</p>
  
  <pre><code>class Countdown extends AnimatedWidget {
    Countdown({ Key key, this.animation }) : super(key: key, listenable: animation);
    Animation&lt;int&gt; animation;
  
    @override
  
    build(BuildContext context){
  
      Duration clockTimer = Duration(seconds: animation.value*60);
  
      String timerText = '${clockTimer.inMinutes.remainder(60).toString()}:${(clockTimer.inSeconds.remainder(60) % 60).toString().padLeft(2, '0')}';
  
      return Text(
        "$timerText",
        style: TextStyle(         
          fontSize: 110,
          color: Theme.of(context).primaryColor,
        ),
      );
  
    }
  }
  </code></pre>
  
  <p>I have an animation controller as follows:</p>
  
  <pre><code>AnimationController _controller;
  
    @override
  
    void dispose(){
      _controller.dispose();
      super.dispose();
    }
  
    void initState() {
      super.initState();
      @override
  
        _controller = AnimationController(
            vsync: this,
          duration: Duration(minutes: gameData.levelClock)  // gameData.levelClock is a user entered number elsewhere in the applciation
        );
  
  
    }
  </code></pre>
  
  <p>And finally here is the part of the code that calls the Countdown widget:</p>
  
  <pre><code>Countdown(
       animation: StepTween(
       begin: gameData.levelClock,   // THIS IS A USER ENTERED NUMBER 
       end: 0,
     ).animate(_controller),
  )
  </code></pre>
  
  <p>Thank you for any help that can be offered.</p>