title: Unidentified Name Error while using required.this value
body: <p>So Iam trying to make a chat-app using Firebase-Firestore where you have an option of creating group. Now after creating a group Iam navigating to a screen from where you can add member. But for that I gonna need to pass the groupRoomId.</p>
  <p>Here Iam navigating to add member screen:</p>
  <pre><code> Navigator.push(
          context,
          MaterialPageRoute(
              builder: (context) =&gt; Add_Member(
                groupRoomId: groupRoomId,
              )));
  </code></pre>
  <p>Now here is my add member screen:</p>
  <pre><code>class Add_Member extends StatefulWidget {
    final String groupRoomId;
    Add_Member({required this.groupRoomId});
    _Add_Member createState() =&gt; _Add_Member();
  }
  
  class _Add_Member extends State&lt;Add_Member&gt; {
    QuerySnapshot&lt;Map&lt;String, dynamic&gt;&gt;? searchResultSnapshot;
    QuerySnapshot&lt;Map&lt;String, dynamic&gt;&gt;? Snapshot;
    bool isLoading = false;
    bool haveUserSearched = false;
    bool isChecked = false;
    DatabaseMethods databaseMethods = new DatabaseMethods();
    var searchEditingController = TextEditingController();
    final DocumentReference &lt;Map&lt;String, dynamic&gt;&gt;? documentReference = FirebaseFirestore.instance.doc(&quot;groups/$groupRoomId&quot;);
  
  addremovemember(userName){
      documentReference?.snapshots().listen((datasnapshot){
        if (datasnapshot.data()!.containsValue(&quot;$userName&quot;)){
          FirebaseFirestore.instance
              .collection('groups')
              .doc('$groupRoomId')
              .update({&quot;users&quot; : FieldValue.arrayRemove([&quot;$userName&quot;])});
        }
        else{
          FirebaseFirestore.instance
              .collection('groups')
              .doc('$groupRoomId')
              .update({&quot;users&quot; : FieldValue.arrayUnion([&quot;$userName&quot;])});
        }
      });
    }
  ......
  </code></pre>
  <p>So what is happening that in DocumentReference $groupRoomId is showing Unidentified Name Error.
  My ultimate aim is to being able to add and remove error(in future too) as you may see in addremovemember function.
  I would highly appreciable if you can help me.</p>