My application is working fine before null safety migration. Afterwards I get a runtime error when attempting to read a record, "Error: [cloud_firestore
/unknown] Expected a value of type '((Object?) => Object)?', but got one of type '(Object) => Object?'"
I thought maybe I did something wrong in the migration, so I created a new application with just the minimum to reproduce. It worked fine on flutter >=2.7.0 but when I changed to >2.12.0 to enable null safety, the same error occurred. It is occurring on the read from the firestore collection:
var s = await FirebaseFirestore.instance
.collection('cautions')
.snapshots()
.first;