title: Unhandled Exception: NoSuchMethodError: The method '[]' was called on null. when accessing firestore
body: <p>I successfully register a new user into firebase but can't create the user's document in firestore.
  I get the following error</p>
  <pre><code>[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: NoSuchMethodError: The method '[]' was called on null.
  E/flutter (18812): Receiver: null
  E/flutter (18812): Tried calling: [](&quot;uid&quot;)
  E/flutter (18812): #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
  E/flutter (18812): #1      new UserModel.fromMap (package:hil_app/models/user_model.dart:17:16)
  E/flutter (18812): #2      AuthController.streamFirestoreUser.&lt;anonymous closure&gt; (package:hil_app/controllers/auth_controller.dart:66:40)
  
  </code></pre>
  <p>Here is my controller class</p>
  <pre><code>  Stream&lt;UserModel&gt; streamFirestoreUser() {
      if (firebaseUser?.value?.uid != null) {
        return _db
            .doc('/users/${firebaseUser.value.uid}')
            .snapshots()
            .map((snapshot) =&gt; UserModel.fromMap(snapshot.data()));
      }
      return null;
    }
  
  </code></pre>
  <p>Here is my User Model</p>
  <pre><code>    return UserModel(
        uid: data['uid'],
        name: data['name'] ?? '',
        email: data['email'] ?? '',
        password: data['password'] ?? '',
        dob: data['dob'] ?? '',
        gender: data['gender'] ?? '',
        phone: data['phone'] ?? '',
        agree: data['accept_terms'] ?? '',
        photoUrl: data['photoUrl'] ?? '',
      );
    }
  </code></pre>
  <p>any idea on how to solve this error?</p>