我是新的颤栗和我正在建立一个社会媒体应用程序通过教程,我现在正在定制。现在,我尝试将更多的输入字段添加到用户配置文件页面中,然后开始获取下面的错误。当我可以登录时,我的时间线页面变成红色,警告Bad state: field does not exist within the DocumentSnapshotPlatform
我运行Flutter clean,现在我的用户无法登录该应用程序。
我得到了这个错误:
E/flutter ( 3971): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Bad sta
我尝试通过文档的"id“来获取特定文档的信息,以显示该文档的信息。
我在服务中使用的代码是:
class SentenciasFireBase {
//This is a class where I have all the services of firebase
...
obtenerVacaciones(String empleado) async {
//empleado is the document id
return await Firestore.instance.document('Vacaciones/$empleado'
我的users集合中有几个文档,它们还没有包含所有可能的字段。
从Firestore获取我的用户(使用cloud_firestore:^2.2.1)会抛出错误。
Bad state: field does not exist within the DocumentSnapshotPlatform
我在try-catch代码块中引发了这个错误。
...
factory User.fromFirestore(DocumentSnapshot doc) {
try {
print(doc.get('some-missing-field'));
} c
我使用VisualStudio作为集成开发环境。在添加cloud_firestore:^0.13.7作为依赖项并运行pub get时,我收到以下错误: [firebase] flutter pub get
Running "flutter pub get" in firebase...
Because cloud_firestore >=0.13.4 depends on cloud_firestore_web ^0.1.1 which depends on firebase ^7.0.0, cloud_firestore
我有我想要获取字段的集合。我遵循了flutter fire的说明,它告诉我使用get()来检索文档快照。我正在创建一个documentsnapshot对象,并尝试获取给定id的所有内容。现在,我正在尝试将这个流传递给streambuilder并显示特定的字段。但是我得到了错误; type '_BroadcastStream<DocumentSnapshot<Map<String, dynamic>>>' is not a subtype of
type
'Stream<QuerySnapshot<Object?>
嘿,伙计们,我有两个顶级的集合,一个用户和一个标签集合。在每个用户文档中,我都有一个文档ID的数组字段,数组中的每个元素表示tabs集合中的一个文档(有点像是指向该文档的引用或指针),我想用ID列表监听用户/文档中的实时更改,并监听tabs集合中相应文档的更改。 下面是到目前为止我的代码,它有两个问题。流不能在客户端工作-当我在云firestore中更新文档时,我没有收到更新的快照。另外,为了获得tabIds的列表,我目前正在对云firestore进行查询,它返回一个流。然而,whereIn操作符只接受一个对象列表,所以我不确定如何处理。 data model screenshot
由于firebase / firestore不支持不同的查询,所以我正在寻找一种在客户端上创建不同列表的方法。原因是,在我的特定情况下,我必须有多个DB查询,这有时会导致返回两个或多个具有相同值(即相同文档)的文档。
我试过像这样创建一个场景
final set = Set<User>.from(_people.map<User>((user) => user));
final distinctList = set.map((user) => user).toList();
/// doesn't work since any duplicate d