答案 0 :(得分:0)
希望您正在使用插件cloud_firestore从Firestore中获取数据
使用您的凭据初始化Firestore,可以从您的google_services.json文件复制该凭据
{libraryName}.js
获取文档
final FirebaseApp app = await FirebaseApp.configure(
name: 'test',
options: const FirebaseOptions(
googleAppID: '1:79601577497:ios:5f2bcc6ba8cecddd',
gcmSenderID: '79601577497',
apiKey: 'AIzaSyArgmRGfB5kiQT6CunAOmKRVKEsxKmy6YI-G72PVU',
projectID: 'flutter-firestore',
),
);
final Firestore firestore = Firestore(app: app);
或
CollectionReference get users=> firestore.collection('users');
await users.where('name', isEqualTo: 'neha').getDocuments();