我正在寻找一种为Firebase安排CloudFunctions或换句话说在特定时间触发它们的方法。 最佳答案 更新2019-04-18现在有一种非常简单的方法可以通过Firebase在CloudFunctions上部署预定代码。您可以使用简单的文本语法:exportscheduledFunctionPlainEnglish=functions.pubsub.schedule('every5minutes').onRun((context)=>{console.log('Thiswillberunevery5minutes!');}
我有一个查询来查找指定条形码的文档ID:FuturefindBarcode()async{StringsearchBarcode=awaitBarcodeScanner.scan();Firestore.instance.collection('${newUser.userLocation}').where('barcode',isEqualTo:'${searchBarcode}').snapshots().listen((data){StringidOfBarcodeValue=data.documents[0].documentID;print(idOfBarcodeValue)
我有一个查询firestore和检索特定用户的功能,但我一直收到同样的错误。我得到的错误如下:I/flutter(29600):ThefollowingNoSuchMethodErrorwasthrownbuildingSellerInfo(dirty,state:I/flutter(29600):_SellerInfoState#90e11):I/flutter(29600):Class'Future'hasnoinstancegetter'displayName'.I/flutter(29600):Receiver:Instanceof'Future'I/flutter(29600
我目前正在开发我的应用程序的聊天功能。我在StreamBuilder中设置了一个AnimatedList,以便使消息反向显示。这是我的代码children:[newFlexible(child:newStreamBuilder(stream:chatRoomRef.document(widget.chatRoomID).collection('messages').orderBy('time').snapshots(),builder:(BuildContextcontext,AsyncSnapshotsnapshot){returnnewAnimatedList(reverse:tr
几天以来,我一直在寻找解决我的问题的方法。我尝试做的是使用结构较低的过滤器从Firestore加载对象。/meetings(collection)/meetingId/people(object)-uid1:1-uid2:1没有where查询,它工作正常。但是因为我想验证对象中的人。我靠着墙走。FirebaseUseruser=awaitFirebaseAuth.instance.currentUser();Firestore.instance.collection('meetings').where('people.${user.uid}',isEqualTo:'1').orderB
在firebase控制台中,您可以将bool值添加为字段甚至是int。我试图通过代码添加这样的数据类型,但它会生成错误。我的代码看起来像IntScore;Boolcompletion;voidaddDetails(){Mapdata={Score:1.0,completion:false,};documentReference.setData(data).whenComplete((){print('Uploaded');}).catchError((e)=>print(e));}控制台错误I/flutter(3284):Anotherexceptionwasthrown:type'_
我在Flutter中有一个应用程序可以在父屏幕中提取大量数据。父屏幕被分成几个子屏幕,然后再转到几个子屏幕。现在,为了确保这不会一直从API中提取数据,我只在根屏幕中提取一次数据-这在90%的时间里都很好。所有后续更新都通过firebase云消息传递在整个应用程序中广播如果我在屏幕3上,我需要更新屏幕1中的数据,这也应该更新最终将显示在屏幕2上的数据。我目前正在使用这种方法来传递我的数据(https://flutter.io/cookbook/navigation/passing-data/)例如,屏幕1包含三个项目。每个项目都有自己的屏幕。屏幕2.1用于项目1,屏幕2.2用于项目2,
我正在使用Flutter云Firestore。这是我的数据库的样子。我想在a_numbers对象中添加更多字段(如“2222”)。我像这样使用updateData(),DocumentReferenceref=Firestore.instance.document("products/-LMhR5cAyW4T0sa03UtU");ref.updateData({"a_numbers":{"2222":false}});上面的代码片段基本上删除了以前的值(1111),然后用2222字段更新了数据库。有什么解决办法吗? 最佳答案 要在不
我想知道如何为Firestore实现Bloc模式。当从flutter默认应用程序应用Bloc增量应用程序时,看起来像这样。classIncrementBlocimplementsBlocBase{int_counter;StreamController_counterController=StreamController();StreamSinkget_inAdd=>_counterController.sink;StreamgetoutCounter=>_counterController.stream;StreamController_actionController=Stream
我有一个包含数组字段的文档。如何更新数组?在firebase函数中,使用typescript,我做了这样的事情:admin.firestore().collection('friendships').doc(caller.data["uid"]).update({friends:admin.firestore.FieldValue.arrayUnion({friendDisplayName:snapshot.data["friendDisplayName"],friendUid:snapshot.ref})})我找不到Flutter的任何替代方案。我该怎么办?