草庐IT

user_model

全部标签

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 - Flutter 将 User 实例传递给另一个状态并保持更新

我正在尝试进行登录/注册过程并将用户重定向到仪表板View。所以我有这个方法:Future_redirectToDashboard()async{varroute=newMaterialPageRoute(builder:(BuildContextcontext)=>newDashboard(userID:userID),);Navigator.of(context).push(route);}然后在login()完成后调用。_register().whenComplete(()=>_redirectToDashboard());然后在Dashboard中我这样做:classDashb

dart - Flutter 将 User 实例传递给另一个状态并保持更新

我正在尝试进行登录/注册过程并将用户重定向到仪表板View。所以我有这个方法:Future_redirectToDashboard()async{varroute=newMaterialPageRoute(builder:(BuildContextcontext)=>newDashboard(userID:userID),);Navigator.of(context).push(route);}然后在login()完成后调用。_register().whenComplete(()=>_redirectToDashboard());然后在Dashboard中我这样做:classDashb

user-interface - AlertDialog 的子容器不覆盖宽度

我想在点击按钮时显示一个弹出窗口。当我尝试使用此AlertDialog的自定义设计子Container显示AlertDialog时,该AlertDialog未覆盖整个空间。它有一些来自角落的填充。我是这样实现的:AlertDialog(shape:OutlineInputBorder(borderRadius:BorderRadius.circular(16.0)),content:SingleChildScrollView(child:Column(children:[Container(color:Colors.redAccent,width:screenSize.width,he

user-interface - AlertDialog 的子容器不覆盖宽度

我想在点击按钮时显示一个弹出窗口。当我尝试使用此AlertDialog的自定义设计子Container显示AlertDialog时,该AlertDialog未覆盖整个空间。它有一些来自角落的填充。我是这样实现的:AlertDialog(shape:OutlineInputBorder(borderRadius:BorderRadius.circular(16.0)),content:SingleChildScrollView(child:Column(children:[Container(color:Colors.redAccent,width:screenSize.width,he