title: Asynchronous Function Error In Dart-Flutter
body: <p>So I'm trying to create a simple Sign In page in Flutter using <code>Google Firebase</code> but Firebase is not giving me desired output. Maybe its error in <code>Asynchronous Function</code> cause its giving me output <code>Instance of 'Future&lt;dynamic&gt;'</code></p>
  <p>Code for Anonymously Sign In dart file:</p>
  <pre><code>import 'package:firebase_auth/firebase_auth.dart';
  
  class AuthService {
    final FirebaseAuth _auth = FirebaseAuth.instance;
  
    Future signAnonymous() async {
      try {
        AuthResult result = await _auth.signInAnonymously();
        FirebaseUser user = result.user;
        return user; 
      } catch (e) {
        print(e.toString());
        return null;
      }
    }
  }
  
  </code></pre>
  <p>Sign In Page Code:</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:freezeria/Screens/services/auth.dart';
  
  class signin extends StatefulWidget {
    @override
    _signinState createState() =&gt; _signinState();
  }
  
  class _signinState extends State&lt;signin&gt; {
    final AuthService _auth = AuthService();
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        backgroundColor: Colors.purple[300],
        appBar: AppBar(
          backgroundColor: Colors.purple[600],
          elevation: 0.0,
          centerTitle: true,
          title: Text('Sign In To Freezeria!'),
        ),
          body: Container(
            padding: EdgeInsets.symmetric(vertical: 20.0, horizontal: 50.0),
            child: ElevatedButton(
              child: Text('SignIn'),
              style: ButtonStyle(
                backgroundColor:
                    MaterialStateProperty.all&lt;Color&gt;(Colors.purple[100]),
              ),
              onPressed: () async {
                dynamic result = _auth.signAnonymous();
                if (result == null) {
                  print(&quot;Error Signing In&quot;);
                } else {
                  print('Signed In');
                  print(result);
                }
              }
            )
         ),
      );
    }
  }
  </code></pre>
  <p>The Output I got was:</p>
  <pre><code>I/flutter ( 8533): Signed In
  I/flutter ( 8533): Instance of 'Future&lt;dynamic&gt;'
  </code></pre>
  <p>I need to get user details provided by the firebase</p>
  <p>Any help will be appreciated :)</p>