草庐IT

sub_model_sk

全部标签

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 - 导入的库 '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

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

dart - pub/sub 是 flutter 的好模式吗

我才刚刚开始学习flutter。目前,我仍在为future而苦苦挣扎。因此,我打算编写一个发布/订阅模式类,它应该是异步结果的中央消息代理。假设,某些方法需要来自http通信的回复。它会像这样使用我的_callbackMethodCall订阅HTTP_AUTHORIZE_USER操作的结果:broker.subscribe(HTTP_AUTHORIZE_USER,_callbackMethodCall);sharedHttpHelper.execute();在另一个http类将像这样发布其结果,其中调用者已将HTTP_AUTHORIZE_USER作为mySubscriberChanne

dart - pub/sub 是 flutter 的好模式吗

我才刚刚开始学习flutter。目前,我仍在为future而苦苦挣扎。因此,我打算编写一个发布/订阅模式类,它应该是异步结果的中央消息代理。假设,某些方法需要来自http通信的回复。它会像这样使用我的_callbackMethodCall订阅HTTP_AUTHORIZE_USER操作的结果:broker.subscribe(HTTP_AUTHORIZE_USER,_callbackMethodCall);sharedHttpHelper.execute();在另一个http类将像这样发布其结果,其中调用者已将HTTP_AUTHORIZE_USER作为mySubscriberChanne

flutter - 如何使 SliverAppBar 在 sub_page 的 SliverList 之前滚动

当我滚动时,我希望可以先滚动SliverAppBar。我该怎么做?现在是sub_page第一。预期效果:在滚动操作中,首选项是SliverAppBar。SliverAppBar显示/隐藏后,继续滚动sub_page。演示(https://github.com/fanybook/cornerstone/blob/master/_docs/flutter_improve_scroll_priority.mp4?raw=true)重点是有子页面(和BottomNavigationBar)。如果单页可以通过多个SliverAppBar/bottom和NestedScrollView的body/