草庐IT

package_test

全部标签

解决cURL error 60: SSL: no alternative certificate subject name matches target host name ‘test.com‘

 按照提示前往libcurl-ErrorCodes说是SSL证书问题 解决方法:1.前往该路径下载https://curl.se/ca/cacert.pem 将文件里的内容全部复制下来,然后替换上图路径的/ca-bundle.crt 里面的内容保存即可若行不通可以尝试第二种方法2.在执行curl操作前在前面加上如下代码$ch=curl_init();curl_setopt($ch,CURLOPT_URL,"https://test.com/");curl_setopt($ch,CURLOPT_HEADER,false);//原本的代码段//...//...//...curl_close($ch

flutter - _断言错误 ('package:firebase_auth/src/firebase_auth.dart' : Failed assertion: line 95 pos 12: 'email != null' : is not true. )

我的目标是使用Firebase在Flutter中构建注册。但是,当我按下包含注册功能的按钮时,应用程序停止并且我收到此错误:异常发生。_AssertionError('package:firebase_auth/src/firebase_auth.dart':断言失败:第95行pos12:'电子邮件!=null':不正确。)与firebase的集成正在运行,问题可能出在没有获取数据的textformfield上......import'package:cloud_firestore/cloud_firestore.dart';import'package:firebase_auth/f

flutter - _断言错误 ('package:firebase_auth/src/firebase_auth.dart' : Failed assertion: line 95 pos 12: 'email != null' : is not true. )

我的目标是使用Firebase在Flutter中构建注册。但是,当我按下包含注册功能的按钮时,应用程序停止并且我收到此错误:异常发生。_AssertionError('package:firebase_auth/src/firebase_auth.dart':断言失败:第95行pos12:'电子邮件!=null':不正确。)与firebase的集成正在运行,问题可能出在没有获取数据的textformfield上......import'package:cloud_firestore/cloud_firestore.dart';import'package:firebase_auth/f

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

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

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

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

dart - 导入 'package:flutter/foundation.dart' ;没有包装文件

我在许多示例中都看到了这个导入语句,但在任何地方都找不到该包的任何文档。import'package:flutter/foundation.dart';我是否漏掉了一些明显的东西?谢谢。 最佳答案 有关flutter/foundation的文档可用herefoundationlibraryCoreFlutterframeworkprimitives.Thefeaturesdefinedinthislibraryarethelowest-levelutilityclassesandfunctionsusedbyalltheotherl

dart - 导入 'package:flutter/foundation.dart' ;没有包装文件

我在许多示例中都看到了这个导入语句,但在任何地方都找不到该包的任何文档。import'package:flutter/foundation.dart';我是否漏掉了一些明显的东西?谢谢。 最佳答案 有关flutter/foundation的文档可用herefoundationlibraryCoreFlutterframeworkprimitives.Thefeaturesdefinedinthislibraryarethelowest-levelutilityclassesandfunctionsusedbyalltheotherl

unit-testing - 如何对 Flutter TextFormField maxlines 进行单元测试

是否可以编写一个单元测试来验证TextFormField的maxLines属性是否设置正确。我找不到访问该属性的方法:我创建一个TextFormFieldfinalfield=TextFormField(initialValue:"hello",key:Key('textformfield'),maxLines:2,);然后在测试中我可以使用tester.widget访问表单字段finalformfield=awaittester.widget(find.byKey(Key('textformfield')));但是由于maxLines属性被传递给返回文本字段的生成器,我如何才能访问文

unit-testing - 如何对 Flutter TextFormField maxlines 进行单元测试

是否可以编写一个单元测试来验证TextFormField的maxLines属性是否设置正确。我找不到访问该属性的方法:我创建一个TextFormFieldfinalfield=TextFormField(initialValue:"hello",key:Key('textformfield'),maxLines:2,);然后在测试中我可以使用tester.widget访问表单字段finalformfield=awaittester.widget(find.byKey(Key('textformfield')));但是由于maxLines属性被传递给返回文本字段的生成器,我如何才能访问文

testing - flutter测试无法输入文字

我一直在尝试测试一个元素,当按下IconButton时,Text对象会更改为TextFormField。当我尝试对此进行测试时,出现以下错误:ATimerisstillpendingevenafterthewidgettreewasdisposed.'package:flutter_test/src/binding.dart':Failedassertion:line672pos7:'_fakeAsync.nonPeriodicTimerCount==0'尽管小部件没有使用任何我知道的计时器?示例代码:awaittester.tap(find.byType(IconButton));a