title: flutter firebase user sign in on app start
body: <p>In the splash screen I  want to check if there is an authenticated user to navigate to the home page 
  and if not go the signup/ login page
  here's my code for the splash screen the method starts and check if there's a user loged in then navigate to home if there's a user loged in</p>
  
  <pre><code>class _SplashScreenState extends State&lt;SplashScreen&gt; {
  final FirebaseAuth _auth = FirebaseAuth.instance;
  FirebaseUser _user;
  Future&lt;FirebaseUser&gt; _getUser() async {
  _user = await _auth.currentUser();
  return _user;
  }
  
  Future startTime() async {
  var _duration = new Duration(seconds: 2);
  return new Timer(_duration, navigationPage());
  }
  
  navigationPage() {
    if (_user != null) {
     Navigator.of(context).pushNamed('/home');
    } else {
     Navigator.of(context).pushNamed('/welcome');
    }
  }
  
  @override
   void initState() {
   super.initState();
   _getUser();
   startTime();
   }
  
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new Center(
        child: new Image.asset(
        'assets/imgs/logo.png',
          width: 162.0,
        height: 58.0,
       ),
      ),
    );
   }
  }
  </code></pre>