我尝试通过文档的"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'
我有一个查询、firestore和检索特定用户的函数,但我总是得到相同的错误。
我得到的错误如下:
I/flutter (29600): The following NoSuchMethodError was thrown building SellerInfo(dirty, state:
I/flutter (29600): _SellerInfoState#90e11):
I/flutter (29600): Class 'Future<User>' has no instance getter 'displayName'.
I/flutter
我正在尝试获取本flutter教程所需的cloud_firestore包:
当我运行flutter packages get时,我只能返回:Package cloud_firestore has no versions that match >=0.7.0 <0.8.0 derived from...
网站上的cloud_firestore包显示最新版本是0.7.2,我也尝试过该版本,但得到了相同的错误。
我还尝试了flutter的dev、master和beta通道,但没有成功获得这个包。
下面是我的pubspec.yaml文件:
name: test_app
descriptio
当我使用DocumentSnapshot时,我正在开发一个flutter app.My flutter项目在工厂构造函数中显示错误 User.dart import 'package:cloud_firestore/cloud_firestore.dart';
class User {
final String id;
final String username;
final String email;
final String photoUrl;
final String displayname;
final String bio;
User
这是我想要完成的事情:我正在建立一个网络商店。网上商店有一个反应前端。前端从Firestore获取,并在商店页面上显示集合数组中的所有项。用户在商店页面上选择一个项目。对我的和服务器进行项字段的签出会话。用户转到Stripe结账表单,并在付款完成后被Stripe发送回我的前端。我在服务器上侦听该事件,然后想要更新Firestore中项目的quantity字段。
但是,如何查询此项的Firestore呢?是否有一种方法只使用这个id字段(或name字段)来查询Firestore?有些东西像:
db
.collection('collections')
我使用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