草庐IT

firebase-ab-testing

全部标签

unit-testing - 有没有办法在 Flutter 单元测试中测试 AppLifecycleState 的变化?

当我的应用移至后台(AppLifecycleState.paused)时,我的应用会将用户首选项写入本地文件,我想为此行为编写一个测试。有没有办法在单元测试中模仿它?或者这是需要作为集成测试完成的事情吗? 最佳答案 您可以在单元测试中调用binding.handleAppLifecycleStateChanged来伪造应用进出前台。 关于unit-testing-有没有办法在Flutter单元测试中测试AppLifecycleState的变化?,我们在StackOverflow上找到一个

firebase-realtime-database - 如何为 FirebaseAnimated 列表迭代 Flutter AsyncSnapshot<DataSnapshot>?

我正在尝试遍历我的Firebase树以填充FirebaseAnimatedList。我需要使用key以及所有提供的值。我假设因为迭代是异步内置到小部件中的,这就是它不像JSON迭代那样工作的原因。这是我的代码...child:newFirebaseAnimatedList(query:fb.child('NumberOnes').orderByChild('Value'),padding:newEdgeInsets.all(8.0),reverse:false,itemBuilder:(_,DataSnapshotfollowerSnap,Animationanimation,intI

firebase-realtime-database - 如何为 FirebaseAnimated 列表迭代 Flutter AsyncSnapshot<DataSnapshot>?

我正在尝试遍历我的Firebase树以填充FirebaseAnimatedList。我需要使用key以及所有提供的值。我假设因为迭代是异步内置到小部件中的,这就是它不像JSON迭代那样工作的原因。这是我的代码...child:newFirebaseAnimatedList(query:fb.child('NumberOnes').orderByChild('Value'),padding:newEdgeInsets.all(8.0),reverse:false,itemBuilder:(_,DataSnapshotfollowerSnap,Animationanimation,intI

firebase - 安装 "firebase_firestore"Flutter插件后Cocoapods报错

这个问题在这里已经有了答案:ConflictswithFlutterFireandnativeGeoFirepluginoniOS(2个答案)关闭5年前。我的应用程序可以与FirebaseRTDB一起使用,但想尝试使用Firestore,所以我按照说明安装了“firebase_firestore”'插件。当我现在运行我的应用程序时,出现以下错误:Resolvingdependenciesof`Podfile`[!]Unabletosatisfythefollowingrequirements:-`Firebase/Firestore`requiredby`firebase_firest

firebase - 安装 "firebase_firestore"Flutter插件后Cocoapods报错

这个问题在这里已经有了答案:ConflictswithFlutterFireandnativeGeoFirepluginoniOS(2个答案)关闭5年前。我的应用程序可以与FirebaseRTDB一起使用,但想尝试使用Firestore,所以我按照说明安装了“firebase_firestore”'插件。当我现在运行我的应用程序时,出现以下错误:Resolvingdependenciesof`Podfile`[!]Unabletosatisfythefollowingrequirements:-`Firebase/Firestore`requiredby`firebase_firest

firebase - flutter/firebase 数据库中的一个简单的 where 子句

今天我开始尝试使用FirebaseLive数据库。也许我在sql方面想得太多了。但是我想做的是从我的数据库中获取一条记录,其中一个值等于一个带有flutter的变量。我的表看起来像这样:我想要实现的是这样的:FirebaseDatabase.instance.reference().child('users').where('User_id',1508)就像我说的。说到实时数据库,我完全是个初学者。我希望有人可以帮助我解决我遇到的这个问题。亲切的问候,纳曼尼克斯 最佳答案 根据firstoredocsFirestore.instan

firebase - flutter/firebase 数据库中的一个简单的 where 子句

今天我开始尝试使用FirebaseLive数据库。也许我在sql方面想得太多了。但是我想做的是从我的数据库中获取一条记录,其中一个值等于一个带有flutter的变量。我的表看起来像这样:我想要实现的是这样的:FirebaseDatabase.instance.reference().child('users').where('User_id',1508)就像我说的。说到实时数据库,我完全是个初学者。我希望有人可以帮助我解决我遇到的这个问题。亲切的问候,纳曼尼克斯 最佳答案 根据firstoredocsFirestore.instan

firebase-realtime-database - Flutter firebase 数据库迭代项目

我想知道如何从Flutter上的路径获取对象列表,这是我获取一个对象并正常工作的方法:staticFuturegetYear(StringyearKey)async{Completercompleter=newCompleter();FirebaseDatabase.instance.reference().child("year").child(yearKey).once().then((DataSnapshotsnapshot){varyear=newYear.fromJson(snapshot.key,snapshot.value);completer.complete(year

firebase-realtime-database - Flutter firebase 数据库迭代项目

我想知道如何从Flutter上的路径获取对象列表,这是我获取一个对象并正常工作的方法:staticFuturegetYear(StringyearKey)async{Completercompleter=newCompleter();FirebaseDatabase.instance.reference().child("year").child(yearKey).once().then((DataSnapshotsnapshot){varyear=newYear.fromJson(snapshot.key,snapshot.value);completer.complete(year

firebase - Flutter 从 Firebase 返回文档的长度

我试图用这个函数返回文档列表的长度:FuturetotalLikes(postID)async{varrespectsQuery=Firestore.instance.collection('respects').where('postID',isEqualTo:postID);respectsQuery.getDocuments().then((data){vartotalEquals=data.documents.length;returntotalEquals;});}我将其初始化为voidinit状态(使用另一个函数调用:voidinitState(){totalLikes(p