title: Why this splash screen code is not working in flutter?
body: <p>main.dart----</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:flutter_app/splashscreen.dart';
  import 'package:flutter_app/homepage.dart';
  import 'package:flutter_app/constants.dart';
  
  void main() =&gt; runApp(MaterialApp(
    title: 'GridView Demo',
    home: SplashScreen(),
    debugShowCheckedModeBanner: false,
    theme: ThemeData(
      primarySwatch: Colors.red,
      accentColor: Color(0xFF761322),
    ),
    routes: &lt;String, WidgetBuilder&gt;{
      SPLASH_SCREEN: (BuildContext context) =&gt; SplashScreen(),
      HOME_SCREEN: (BuildContext context) =&gt; HomeScreen(),
      //GRID_ITEM_DETAILS_SCREEN: (BuildContext context) =&gt; GridItemDetails(),
    },
  ));
  
  
  </code></pre>
  
  <p>slashscreen.dart------</p>
  
  <pre><code>
  import 'dart:async';
  import 'package:flutter/cupertino.dart';
  import 'package:flutter/material.dart';
  import 'package:flutter_app/constants.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.end,
              mainAxisSize: MainAxisSize.min,
              children: &lt;Widget&gt;[
                Padding(
                  padding: EdgeInsets.only(bottom: 30.0),
                  child: new Image.asset(
                    'assets/r1.png',
                    height: 25.0,
                    fit: BoxFit.scaleDown,
                  ),
                )
              ],
            ),
            new Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: &lt;Widget&gt;[
                new Image.asset(
                  'assets/r2.png',
                  width: animation.value * 250,
                  height: animation.value * 250,
                ),
              ],
            ),
          ],
        ),
      );
    }
  }
  
  
  
  </code></pre>
  
  <p>homepage.dart--------</p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  
  class HomeScreen extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(title: Text("Table Widget")),
        body: Center(child:Text('jai sri ram ')
        ) 
      );
    }
  }
  
  </code></pre>
  
  <p>constants.dart-----</p>
  
  <pre><code>String SPLASH_SCREEN='SPLASH_SCREEN';
  String HOME_SCREEN='HOME_SCREEN';
  
  
  </code></pre>
  
  <p>1.Error undefined name 'SPLASH_SCREEN'</p>
  
  <p>2.Error undefined name 'HOME_SCREEN'</p>
  
  <p>3.How can I solve this error?</p>
  
  <p>I don't know why these undefined name errors appear in the screen.I don't  know how to solve these errors.</p>
  
  <p>How can I resolve undefined name SPLASH_SCREEN &amp; HOME_SCREEN error ?</p>
  
  <p>Please help me..Thank you </p>