How can I set values to Firestore from a list

I am trying to make a grading app and I wanted to list students from Firestore and fill their grades and I have got the list for the students list but I cant get the number to work I have a working attendance code that only uses boolean values here is the working code for booleans

                                  value: switchStates[
                                  onChanged: (value) {
                                    setState(() {
                                      stateofvalue = value;
                                        students[index].data()["id"], value);
                                  activeColor: Color(0xff2fbd9f),

this is how I call the values

    CollectionReference users = FirebaseFirestore.instance.collection('users');
Future<void> markAttendance() {
    Map<String, dynamic> resultMap = {};
    var formatter = new DateFormat('dd-MM-yyyy');
    String todaysDate = formatter.format(now);

    switchStates.forEach((key, value) {
    for (var i = 0; i < keys.length; i++) {
      resultMap["${keys[i]}"] = values[i];

and this is how I set th value but now I want to set grades in the same manner how can I manage to do that by replacing Switch() with TextFeild()