title: Flutter: re-render child widget on parent state change
body: <p>So a have a stateful parent with a <code>timer</code> value. This timer can be reset by the user. I also have a child stateful widget with an animation controller. The parent passes the <code>timer</code> value to this child to reset the animation. Here is some code:</p>
  <pre class="lang-dart prettyprint-override"><code>class _ParentState extends State&lt;Parent&gt; {
    int timer = 20;
    
    void _userInput() {
      setState(() {
        timer = 20;
      }
    }
  
    @override
    Widget build(BuildContext context) {
      return Child(
        time: timer
      );
    }
  }
  </code></pre>
  <p><strong>Note</strong>: this is striped down for simplicity</p>
  <p>So when my user triggers the <code>_userInput</code> method, the timer value gets changed but the child doesn't. Here is my full child widget:</p>
  <pre class="lang-dart prettyprint-override"><code>class TimerProgress extends StatefulWidget {
    TimerProgress({
      Key key,
      @required this.time,
      @required this.onCompleted
    }) : super(key: key);
  
    final int time;
    final Function onCompleted;
  
    @override
    _TimerProgressState createState() =&gt; _TimerProgressState();
  }
  
  class _TimerProgressState extends State&lt;TimerProgress&gt; with SingleTickerProviderStateMixin {
    AnimationController _controller;
    Animation&lt;double&gt; _widthAnimation;
  
    @override
    void initState() {
      _controller = AnimationController(
        duration: Duration(seconds: widget.time),
        vsync: this
      );
  
      _widthAnimation = Tween&lt;double&gt;(
        begin: 200,
        end: 0
      ).animate(CurvedAnimation(
        parent: _controller,
        curve: Curves.linear
      ));
  
      _controller.addListener(() {
        if (_controller.value == 1) {
          widget.onCompleted();
        }
      });
  
      _controller.forward();
  
      super.initState();
    }
  
    @override
    void dispose() {
      _controller.dispose();
      super.dispose();
    }
  
    @override
    Widget build(BuildContext context) {
      return ...
    }
  }
  </code></pre>
  <p>So this all works, but ideally I want the animation to be reset, which doesn't work...</p>