title: After updating cloud firestore: The operator '[]' isn't defined for the type 'Object'. Try defining the operator '[]'
body: <p>Every thing was working good but when i upgraded my cloud firestore dependecy. I started getting an error &quot;The operator '[]' isn't defined for the type 'Object'. &quot;. This error is coming in front of all the 4 userData.data()[&quot;&quot;],</p>
  <pre><code>class BaseProvider with ChangeNotifier {
    //instances of firebase
  
    final FirebaseAuth _auth = FirebaseAuth.instance;
  
    final CollectionReference postsCollection =
        FirebaseFirestore.instance.collection(&quot;posts&quot;);
  
    final CollectionReference userCollection =
        FirebaseFirestore.instance.collection(&quot;users&quot;);
  
    //Creating post
  
    Future addPost(
      
    ) async {
      DocumentSnapshot userData =
          await userCollection.doc(_auth.currentUser.uid).get();
      return await postsCollection.doc().set({
        &quot;id&quot;: _auth.currentUser.uid,
        &quot;sellername&quot;: userData.data()[&quot;name&quot;],      //Error
        &quot;sellercontact&quot;: userData.data()[&quot;phone&quot;],  //Error
        &quot;sellercity&quot;: userData.data()[&quot;city&quot;],      //Error
        &quot;sellerstate&quot;: userData.data()[&quot;state&quot;],    //Error
        
      });
    }
  </code></pre>