title: The argument type 'Future<dynamic>' can't be assigned to the parameter type 'String'
body: <p>I've seen similar questions that were asked in regards to this but my problem is a little different in that I'm keeping my application modular so I have defined the following method in a different dart file(Simply a class, not a widget):</p>
  <pre><code>Future getProfile() async {
  return await usersCollection.doc(uid).get().then&lt;dynamic&gt;((DocumentSnapshot snapshot) async {
    print(snapshot.data()['name']);
    if(snapshot.data()['name'] == null){
      print(&quot;No name exists&quot;);
    }
    else {
      return snapshot.data()['name'];
    }
  });
  </code></pre>
  <p>And I'm trying to use it's value on my home widget:</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:carpoolapp/services/auth.dart';
  import 'package:carpoolapp/services/database.dart';
  import 'package:firebase_auth/firebase_auth.dart';
  
  class Home extends StatefulWidget {
  
    @override
    _HomeState createState() =&gt; _HomeState();
  }
  
  class _HomeState extends State&lt;Home&gt; {
    final AuthService _auth = AuthService();
  
    User user = FirebaseAuth.instance.currentUser;
  
    DatabaseService db = DatabaseService(uid: FirebaseAuth.instance.currentUser.uid);
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
          backgroundColor: Colors.redAccent,
          appBar: AppBar(
            title: Text('Signed in'),
            backgroundColor: Colors.blueAccent,
            elevation: 0.0, //no drop shadow
            actions: &lt;Widget&gt;[
              FlatButton.icon(
                  onPressed: () async {
                    await _auth.signOutUser();
                  },
                  icon: Icon(Icons.person),
                  label: Text('logout')),
            ],
          ),
          body: Text(db.getProfile()), // Error is here
          //body: UserTile(user: FirebaseAuth.instance().getCurrentUser()),
      );
    }
  }
  
  </code></pre>
  <p>How do I go about making this work without sacrificing the modularity?</p>