首先,您必须创建类别模型的实例,然后根据您的需求更改值
100
Categories c = categories; // here assign your exiting data of categories
c.copyWith(flavor : ["hello","world"]);
await FirebaseFirestore.instance
.collection('user')
.doc(FirebaseAuth.instance.currentUser?.uid)
.collection('todos')
.doc(map["collectionId"])
.update(FieldValue.arrayUnion(c)))