title: Flutter - Trying to build a future context to check if user is logged in, but my build method has an error
body: <p>Fairly newish to flutter, and I have an app that can succesfully log into Firebase.  However now I'm trying to make it so the app skips the registration page if the user is already registered.  I started a new template for this post.</p>
  
  <p>I used this post: <a href="https://stackoverflow.com/questions/55463574/flutter-how-to-check-if-the-user-is-logged-in-if-so-show-other-screen">How to correctly check if a user is logged in</a> for the inspiration, but mine seems to throw an error.  I'm using VSCODE if that makes a difference:</p>
  
  <pre><code>import 'package:buildfuture/FirstPage.dart';
  import 'package:buildfuture/SecondPage.dart';
  import 'package:flutter/material.dart';
  import 'package:firebase_auth/firebase_auth.dart';
  
  void main() {
    runApp(MyApp());
  }
  
  class MyApp implements StatelessWidget {
  
    @override 
      Widget build() {
        return FutureBuilder&lt;FirebaseUser&gt;( 
          future: FirebaseAuth.instance.currentUser(),
          builder: (BuildContext context, AsyncSnapshot&lt;FirebaseUser&gt; snapshot) {
  
            if (snapshot.hasData) {
              FirebaseUser user = snapshot.data;
              return First();
            }
             return Second();
            }
        );
      }
  }
  </code></pre>
  
  <p>I don't understand the error: </p>
  
  <blockquote>
    <p>'Object.toString' ('String Function()') isn't a valid override of
    'Diagnosticable.toString' ('String Function({DiagnosticLevel
    minLevel})').</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>'MyApp.build' ('Widget Function()') isn't a valid override of
    'StatelessWidget.build' ('Widget Function(BuildContext)').</p>
  </blockquote>
  
  <p>Just in case I've also included FirstPage.dart.  SecondPage.dart is exactly the same except the class is named Second</p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  class First extends StatelessWidget {
  
    @override
    Widget build(BuildContext context){
      return new Container(
        child: new Center(
          child: new Icon(Icons.accessibility_new, size: 150.0, color: Colors.brown)
        )
      );
    }
  }
  </code></pre>