When I use the Test Function I get the following error:
Compilation error: Info: Compiling with sound null safety lib/main.dart:15:10: Error: Undefined name 'FirebaseFirestore'. return FirebaseFirestore.instance ^^^^^^^^^^^^^^^^^ Error: Compilation failed.
Here's my code:
dynamic generateHistory(DocumentReference id) {
/// MODIFY CODE ONLY BELOW THIS LINE
return FirebaseFirestore.instance
.collection('chat_messages')
.where('chat', isEqualTo: id)
.orderBy('timestamp')
.snapshots()
.map((snapshot) => snapshot.docs
.map((doc) => {'role': doc['role'], 'text': doc['text']})
.toList());
/// MODIFY CODE ONLY ABOVE THIS LINE
}