I don't know why it's giving this error and also not updating the data in firestore.
FirebaseFirestore.instance
.collection('extra')
.doc(widget.extraName)
.update(
{
'subExtra':
FieldValue.arrayUnion([
{
'name':
_subNameTextController
.text,
}
])
},
);