Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined name 'Firestore' Flutter

dependencies:
  flutter:
    sdk: flutter
    


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.2
  cloud_firestore:

I config it properly please help

like image 449
winklemad Avatar asked Jun 05 '26 06:06

winklemad


2 Answers

There is no class named Firestore. Use FirebaseFirestore.instance instead.

example:

var snapshot = FirebaseFirestore.instance
          .collection('chat')
          .orderBy('createdAt', descending: true)
          .snapshots();
like image 182
aligator Avatar answered Jun 08 '26 00:06

aligator


Change the name from 'Firestore' to 'FirebaseFirestore'.

like image 32
Sagnik Ghosh Avatar answered Jun 08 '26 00:06

Sagnik Ghosh