title: Flutter Delayed Animation code Error : AnimationController.forward() called after AnimationController.dispose()
body: <p>I have implemented a delayed animation in my welcome screen, but I get this below error in my flutter App. Let me know if there is an error in my code that I can correct and fix this issue.</p>
  <p>The error is :</p>
  <pre><code>E/flutter (11565): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)]
  Unhandled Exception:
  'package:flutter/src/animation/animation_controller.dart': Failed
  assertion: line 455 pos 7: '_ticker != null':
  AnimationController.forward() called after
  AnimationController.dispose()
  </code></pre>
  <p>Here is my code:</p>
  <pre class="lang-dart prettyprint-override"><code>class DelayedAnimation extends StatefulWidget {
    final Widget child;
    final int delay;
   
    DelayedAnimation({@required this.child, this.delay});
  
    @override
    _DelayedAnimationState createState() =&gt; _DelayedAnimationState();
  }
  
  class _DelayedAnimationState extends State&lt;DelayedAnimation&gt; with TickerProviderStateMixin {
    AnimationController _controller;
    Animation&lt;Offset&gt; _animOffset;
  
    @override
    void initState() {
      super.initState();
  
      _controller = AnimationController(
        vsync: this,
        duration: Duration(milliseconds: 800),
      );
      final curve = CurvedAnimation(
        curve: Curves.decelerate,
        parent: _controller,
      );
      _animOffset = Tween&lt;Offset&gt;(
        begin: const Offset(0.0, 0.35),
        end: Offset.zero,
      ).animate(curve);
  
      if (widget.delay == null) {
        _controller.forward();
      } else {
        Timer(Duration(milliseconds: widget.delay), () {
          _controller.forward();
        });
      }
    }
  
    @override
    void dispose() {
      super.dispose();
      _controller.dispose();
    }
  
    @override
    Widget build(BuildContext context) {
      return FadeTransition(
        child: SlideTransition(
          position: _animOffset,
          child: widget.child,
        ),
        opacity: _controller,
      );
    }
  }
  </code></pre>