title: The operator '[]' isn't defined for the type 'Object'. Try defining the operator '[]'
body: <p>My code is given below the error I am facing issue in accessing the username from firebase in this line</p>
  <p><code>snapshot.data['username']</code></p>
  <p>It gives the error mentioned above</p>
  <p>The only way I know to access the map data is this</p>
  <pre class="lang-dart prettyprint-override"><code>FutureBuilder&lt;Object&gt;(
    future: FirebaseFirestore.instance
     .collection('users')
     .doc(userId)
     .get(),
    builder: (context, snapshot) {
      if (snapshot.connectionState == ConnectionState.waiting) {
        return Text(&quot;Loading...&quot;);
      }
      return Text(
        snapshot.data['username'],
        style: TextStyle(
          fontWeight: FontWeight.bold,
        ),
      );
    }
  ),
  </code></pre>