title: Flutter: Ticker must be disposed before calling super.dispose()
body: <p>I don't know why  this error is appearing in the console box</p>
  
  <p>Console message: </p>
  
  <blockquote>
    <p>SplashScreenState created a Ticker via its SingleTickerProviderStateMixin, but at the time dispose() was called on the mixin, that Ticker was still active. The Ticker must be disposed before calling super.dispose(). 
    Tickers used by AnimationControllers should
     be disposed by calling dispose() on
     the AnimationController itself. Otherwise, 
    the ticker will leak.
    The offending ticker was: 
    Ticker(created by SplashScreenState#dae31(lifecycle state: created))</p>
  </blockquote>
  
  <p><strong>HERE IS MY FULL CODE FOR SPLASHSCREEN:</strong></p>
  
  <pre><code>import 'dart:async';
  import 'package:flutter/cupertino.dart';
  import 'package:flutter/material.dart';
  
  
  class SplashScreen extends StatefulWidget {
    @override
    SplashScreenState createState() =&gt; new SplashScreenState();
  }
  
  class SplashScreenState extends State&lt;SplashScreen&gt;
      with SingleTickerProviderStateMixin {
    var _visible = true;
  
    AnimationController animationController;
    Animation&lt;double&gt; animation;
  
    startTime() async {
      var _duration = new Duration(seconds: 3);
      return new Timer(_duration, navigationPage);
    }
  
    void navigationPage() {
      Navigator.of(context).pushReplacementNamed(HOME_SCREEN);
    }
  
  
  
  
    @override
    void initState() {
      super.initState();
      animationController = new AnimationController(
        vsync: this,
        duration: new Duration(seconds: 2),
      );
      animation =
      new CurvedAnimation(parent: animationController, curve: Curves.easeOut);
  
      animation.addListener(() =&gt; this.setState(() {}));
      animationController.forward();
  
      setState(() {
        _visible = !_visible;
      });
      startTime();
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Stack(
          fit: StackFit.expand,
          children: &lt;Widget&gt;[
  
            new Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: &lt;Widget&gt;[
                new Image.asset(
                  'assets/vegan1.png',
                  width: animation.value * 280,
                  height: animation.value * 280,
                ),
              ],
            ),
          ],
        ),
      );
    }
  }
  
  
  </code></pre>
  
  <p>How can I solve this error. Please answer if you have any solution or idea to solve this.only added important points are added reduce the size of code. If you need more console code then please comment. </p>