title: How to resolve this error Type 'FirebaseUser' is not a subtype of type 'String'?
body: <p>I am getting this exception while running my app:</p>
  <blockquote>
  <p>type 'FirebaseUser' is not a subtype of type 'String'</p>
  </blockquote>
  <p>The app is working. It does the phone authentication and then move to the next page based on same given condition. But when i hit the back button it throws the exception also in the app it is visible.</p>
  <p>This is my code.</p>
  <pre><code>import 'package:cloud_firestore/cloud_firestore.dart';
  import 'package:firebase_auth/firebase_auth.dart';
  import 'package:flutter/material.dart';
  
  import 'AccountDetialsPage.dart';
  import 'Homepage.dart';
  import 'Phoneverification.dart';
  
  void main() {
    runApp(MyApp());
  }
  
  class MyApp extends StatefulWidget {
    @override
    _MyAppState createState() =&gt; _MyAppState();
  }
  
  class _MyAppState extends State&lt;MyApp&gt; {
    final Firestore firestore = Firestore.instance;
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        debugShowCheckedModeBanner: false,
        home: FutureBuilder(
            future: getCurrentUser(),
            builder: (context, snapshot) {
              if (snapshot.connectionState != ConnectionState.done) {
                return Text(&quot;Loading...&quot;);
              }
  
              return StreamBuilder(
              stream: FirebaseAuth.instance.onAuthStateChanged,
              builder: (BuildContext context, snapshot) {
                if (snapshot.hasData){
                  return StreamBuilder(
                    stream: firestore
                        .collection('users')
                        .document(snapshot.data)
                        .snapshots(),
                      builder: (context, snapshot){
                        if (snapshot.hasData){
                          if (snapshot.data[&quot;verified&quot;] == true){
                            return HomePage();
                          }
                          else{
                            return AccountDetialsPage();
                          }
                        }
                      else{
                        return Text('Loading StreamBuilder');
                        }                  
                      }
  
                  );
  
                }
                else{
                  return Phoneverification();
                }
              },
              );
            }),
      );
    }
  
    Future&lt;String&gt; getCurrentUser() async {
      final FirebaseAuth _auth = FirebaseAuth.instance;
      final FirebaseUser user = await _auth.currentUser();
      final uid = user.uid;
      var number = user.phoneNumber;
      return number.toString();
  
    }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/RzwT7.png" rel="nofollow noreferrer">enter image description here</a></p>