title: type 'DocumentSnapshot' is not a subtype of type 'Map<String, dynamic>'
body: <p><strong>This is my profile Page</strong><br />
  I also tried snapshot.data()
  and also tried converting it to Map data by seeing some other StackOverflow answers.
  Please help me to resolve this issue.</p>
  <p>The error is in line number 63.
  I am not sure how to get that correct. Actually, in the tutorial, they showed for from document but I have to use FromMap But I am not sure How to use that</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:cloud_firestore/cloud_firestore.dart';
  import 'package:firebase_storage/firebase_storage.dart' as firebase_storage;
  import 'package:provider/provider.dart';
  import 'package:cached_network_image/cached_network_image.dart';
  
  import 'package:justpoll/screens/profile/edit_profile.dart';
  import 'package:justpoll/screens/profile/profile_nav_bar/settings.dart';
  import 'package:justpoll/screens/profile/profile_nav_bar/help.dart';
  import 'package:justpoll/Constants.dart';
  import 'package:justpoll/widgets/progress.dart';
  import 'package:justpoll/libmodels/user_model.dart';
  import 'package:justpoll/libservices/authentication_service.dart';
  import 'package:justpoll/screens/home_page/nav.dart';
  
  class Profile2 extends StatefulWidget {
    final String profileId;
  
    Profile2({this.profileId});
    @override
    _Profile2State createState() =&gt; new _Profile2State();
  }
  
  final userRef = FirebaseFirestore.instance.collection(&quot;users&quot;);
  
  class _Profile2State extends State&lt;Profile2&gt; {
    buildProfileButton() {
      return Text(&quot;profile Button&quot;);
    }
  
    Column buildCountColumn(String lable, int count) {
      return Column(
        mainAxisSize: MainAxisSize.min,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Text(
            count.toString(),
            style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold),
          ),
          Container(
            margin: EdgeInsets.only(top: 4.0),
            child: Text(
              lable,
              style: TextStyle(
                color: Colors.grey,
                fontSize: 15.0,
                fontWeight: FontWeight.w400,
              ),
            ),
          )
        ],
      );
    }
  
    buiildProfileHeader() {
      return FutureBuilder(
        future: userRef.doc(widget.profileId).get(),
        builder: (context, snapshot) {
          if (!snapshot.hasData) {
            return circularProgress();
          }
  
          UserModel user = UserModel.fromMap(snapshot.data.data);
  
          return Padding(
            padding: EdgeInsets.all(16.0),
            child: Column(
              children: [
                Row(
                  children: [
                    CircleAvatar(
                      radius: 40.0,
                      backgroundColor: Colors.grey,
                      backgroundImage: CachedNetworkImageProvider(user.photoUrl),
                    ),
                    Expanded(
                      flex: 1,
                      child: Column(
                        children: [
                          Row(
                            mainAxisSize: MainAxisSize.max,
                            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                            children: [
                              buildCountColumn(&quot;posts&quot;, 0),
                              buildCountColumn(&quot;follower&quot;, 0),
                              buildCountColumn(&quot;following&quot;, 0),
                            ],
                          ),
                          Row(
                            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                            children: [
                              buildProfileButton(),
                            ],
                          )
                        ],
                      ),
                    ),
                  ],
                ),
                Container(
                  alignment: Alignment.centerLeft,
                  padding: EdgeInsets.only(top: 12.0),
                  child: Text(
                    user.username,
                    style: TextStyle(
                      fontWeight: FontWeight.bold,
                      fontSize: 16.0,
                    ),
                  ),
                ),
                Container(
                  alignment: Alignment.centerLeft,
                  padding: EdgeInsets.only(top: 4.0),
                  child: Text(
                    user.name,
                    style: TextStyle(
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                ),
                Container(
                  alignment: Alignment.centerLeft,
                  padding: EdgeInsets.only(top: 2.0),
                  child: Text(
                    user.bio,
                  ),
                ),
              ],
            ),
          );
        },
      );
    }
  
    @override
    Widget build(BuildContext context) {
      return new Scaffold(
        appBar: new AppBar(
          iconTheme: IconThemeData(color: MyColors.black),
          backgroundColor: Colors.white,
          actions: [
            Padding(
              padding: const EdgeInsets.all(13.0),
              child: GestureDetector(
                onTap: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(
                      builder: (context) =&gt; EditProfile(),
                    ),
                  );
                },
                child: Icon(
                  Icons.edit,
                  color: MyColors.black,
                  size: 26,
                ),
              ),
            ),
          ],
        ),
        drawer: new Drawer(
            child: new ListView(
          children: &lt;Widget&gt;[
            new ListTile(
              leading: Icon(Icons.settings),
              title: new Text('Settings'),
              onTap: () {
                Navigator.of(context).push(
                  MaterialPageRoute(builder: (context) =&gt; SettingsScreen()),
                );
              },
            ),
            new ListTile(
              leading: Icon(Icons.bookmark),
              title: new Text('Bookmarks'),
              onTap: () {},
            ),
            new ListTile(
              leading: Icon(Icons.drafts),
              title: new Text('Drafts'),
              onTap: () {},
            ),
            new ListTile(
              leading: Icon(Icons.archive),
              title: new Text('Archive'),
              onTap: () {},
            ),
            new ListTile(
              leading: Icon(Icons.help),
              title: new Text('help'),
              onTap: () {
                Navigator.of(context).push(
                  MaterialPageRoute(builder: (context) =&gt; HelpPage()),
                );
              },
            ),
          ],
        )),
        body: ListView(
          children: &lt;Widget&gt;[
            buiildProfileHeader(),
          ],
        ),
      );
    }
  }
  </code></pre>
  <p><strong>And This is my user module</strong></p>
  <pre><code>class UserModel {
    String email;
    String uid;
    String username;
    String name;
    DateTime timestamp;
    bool isPrivate;
    String photoUrl;
    String gender;
    String bio;
    String birthday;
    Map followers;
    Map following;
  
    UserModel({
      this.email,
      this.uid,
      this.username,
      this.timestamp,
      this.name,
      this.photoUrl,
      this.isPrivate,
      this.gender,
      this.bio,
      this.birthday,
      this.followers,
      this.following,
    });
  
    Map toMap(UserModel user) {
      var data = Map&lt;String, dynamic&gt;();
  
      data[&quot;uid&quot;] = user.uid;
      data[&quot;username&quot;] = user.username;
      data[&quot;email&quot;] = user.email;
      data['name'] = user.name;
      data['photoUrl'] = user.photoUrl;
      data[&quot;timestamp&quot;] = user.timestamp;
      data[&quot;isPrivate&quot;] = user.isPrivate;
      data[&quot;gender&quot;] = user.gender;
      data[&quot;bio&quot;] = user.bio;
      data[&quot;birthday&quot;] = user.birthday;
      data[&quot;followers&quot;] = user.followers;
      data[&quot;following&quot;] = user.following;
      return data;
    }
  
    UserModel.fromMap(Map&lt;String, dynamic&gt; mapData) {
      this.uid = mapData[&quot;uid&quot;];
      this.username = mapData[&quot;username&quot;];
      this.email = mapData[&quot;email&quot;];
      this.name = mapData[&quot;name&quot;];
      this.isPrivate = mapData[&quot;isPrivate&quot;];
      this.gender = mapData[&quot;gender&quot;];
      this.photoUrl = mapData[&quot;photoUrl&quot;];
      this.bio = mapData[&quot;bio&quot;];
      this.birthday = mapData[&quot;birthday&quot;];
      this.followers = mapData[&quot;followers&quot;];
      this.following = mapData[&quot;following&quot;];
    }
  }
  </code></pre>