title: Flutter AnimationController with dynamic duration - error: Const variables must be initialized with a constant value
body: <p>I want to set the animation duration from my widget parameter but it doesn't work because duration wants to be initialized with a constant</p>
  
  <pre><code>class CircularTimer extends StatefulWidget {
    CircularTimer({@required this.seconds});
    _CircularTimer createState() =&gt; _CircularTimer();
    final seconds;
  }
  
  class _CircularTimer extends State&lt;CircularTimer&gt;
      with SingleTickerProviderStateMixin {
    Animation&lt;double&gt; animation;
    AnimationController controller;
  
    @override
    void initState() {
      super.initState();
      controller = AnimationController(
          duration: const Duration(/*not working*/seconds: widget.seconds), vsync: this);
      animation = Tween&lt;double&gt;(begin: 0, end: 300).animate(controller);
      controller.forward();
    }
  
    @override
    Widget build(BuildContext context) =&gt;
        CircularTimerWidget(animation: animation);
  }
  </code></pre>