title: Can't get Flutter Countdown/Timer Widget to count down
body: <p>I'm trying to create a simple widget which counts down from 10 upon getting built. I expected this to start counting down but it remains stuck on 10. Could anyone see what is going wrong here?</p>
  <pre><code>class GameTimer extends StatefulWidget {
    const GameTimer({
      Key? key,
    }) : super(key: key);
  
    @override
    State&lt;GameTimer&gt; createState() =&gt; _GameTimerState();
  }
  
  class _GameTimerState extends State&lt;GameTimer&gt; {
    initState() {
      _startTimer();
    }
  
    int _counter = 10;
    late Timer _timer;
  
    void _startTimer() {
      _counter = 10;
      _timer = Timer.periodic(Duration(seconds: 1), (timer) {
        setState() {
          _counter--;
        }
      });
    }
  
    @override
    Widget build(BuildContext context) {
      return SizedBox(
          child: Text('$_counter',
              style: TextStyle(
                fontSize: 48,
                fontWeight: FontWeight.bold,
              )));
    }
  }
  </code></pre>