草庐IT

my_model_instance

全部标签

firebase - 如何在 Scoped Model 中从 Firestore 获取数据 - Flutter

我正在尝试从Firestore获取数据,在调试打印中,future会完成它的工作,列表获取数据,在debugPrint中,长度为+,但是当我尝试在另一个Widget列表中获取数据时,返回null,在debugPrint中,长度为0.模型.DartclassBBModelextendsModel{int_counter=10;intgetcounter=>_counter;vardb=dbBB;List_bbs;Listgetbbs=>_bbs;Future>getBBs()async{varsnapshot=awaitdb.getDocuments();for(inti=0;i主.da

firebase - 如何在 Scoped Model 中从 Firestore 获取数据 - Flutter

我正在尝试从Firestore获取数据,在调试打印中,future会完成它的工作,列表获取数据,在debugPrint中,长度为+,但是当我尝试在另一个Widget列表中获取数据时,返回null,在debugPrint中,长度为0.模型.DartclassBBModelextendsModel{int_counter=10;intgetcounter=>_counter;vardb=dbBB;List_bbs;Listgetbbs=>_bbs;Future>getBBs()async{varsnapshot=awaitdb.getDocuments();for(inti=0;i主.da

android - 未处理的异常 : NoSuchMethodError while setting values in setter in Model class

我正在学习Flutter编程。我正在制作一个简单的注册表,目前只有2个字段,姓名和出生日期。我已经使用db成功创建了一个简单的笔记制作应用程序,因此请按照此处的相同说明进行操作。但是遇到错误“未处理的异常:NoSuchMethodError:setter'regday='wascalledonnull。”注册模型类classRegistrationModel{int_id;String_name;String_dob;String_regDay;RegistrationModel(this._name,this._dob,[this._regDay]);RegistrationMode

android - 未处理的异常 : NoSuchMethodError while setting values in setter in Model class

我正在学习Flutter编程。我正在制作一个简单的注册表,目前只有2个字段,姓名和出生日期。我已经使用db成功创建了一个简单的笔记制作应用程序,因此请按照此处的相同说明进行操作。但是遇到错误“未处理的异常:NoSuchMethodError:setter'regday='wascalledonnull。”注册模型类classRegistrationModel{int_id;String_name;String_dob;String_regDay;RegistrationModel(this._name,this._dob,[this._regDay]);RegistrationMode

flutter :- How to parse the JSON from the model class in flutter?

我在flutter中像下面的代码一样从键和值中解析JSONFuturelogin()async{varbody=json.encode({"MOB":"1112223330","KEY":"123456"});returnhttp.post(Uri.encodeFull("https://MY_Server/Users/login"),body:body.toString(),headers:{'Content-type':'application/json'}).then((response){print("ResponseStatus:$response");if(response

flutter :- How to parse the JSON from the model class in flutter?

我在flutter中像下面的代码一样从键和值中解析JSONFuturelogin()async{varbody=json.encode({"MOB":"1112223330","KEY":"123456"});returnhttp.post(Uri.encodeFull("https://MY_Server/Users/login"),body:body.toString(),headers:{'Content-type':'application/json'}).then((response){print("ResponseStatus:$response");if(response

dart - 尝试调用 : ancestorStateOfType(Instance of 'TypeMatcher<NavigatorState>'

我正在尝试在ListView中点击行项目来调用新页面,我对flutter很陌生classMyAppextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){returnMaterialApp(title:"MyFirstFlutterApp",home:newHome());}}classHomeextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){//TODO:implementbuildreturnnewScaffold(appBar:

dart - 尝试调用 : ancestorStateOfType(Instance of 'TypeMatcher<NavigatorState>'

我正在尝试在ListView中点击行项目来调用新页面,我对flutter很陌生classMyAppextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){returnMaterialApp(title:"MyFirstFlutterApp",home:newHome());}}classHomeextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){//TODO:implementbuildreturnnewScaffold(appBar:

class org.apache.kafka.common.serialization.StringSerializer is not an instance of org.apache.kafka.

问题当我们运行一个程序报错classorg.apache.kafka.common.serialization.StringSerializerisnotaninstanceoforg.apache.kafka.common.serialization.Deserializer原因classorg.apache.kafka.common.serialization.StringSerializer不是org.apache.kafka.common.serialization.Deserializer的实例从而无法创建消费者Failedtoconstructkafkaconsumer解决将Str

dart - 导入的库 'package:geolocator/model/position.dart' 不能有 part-of 指令

在我的flutter应用程序中,我一直在使用以下插件permission_handler,geolocator和google_api_availibility.我本可以从flutter包frompubspec.yml添加这个插件,但是,在我的应用程序中,我使用的是google_map_flutter一直在使用AndroidX支持库的插件。由于这个原因,我在本地添加了这些库,并进行了一些更改以与AndroidX一起使用。所以我的应用程序结构和pubspecs看起来像这样。所以在我的应用程序pubspecs.yml中dev_dependencies:flutter_test:sdk:flu