草庐IT

Flutter_Blue

全部标签

flutter - 如何在几秒钟后返回一个小部件?

returnContainer(color:Colors.transparent,child:Column(children:[Container(color:Colors.transparent,height:30,child:RaisedButton(child:Column(children:[Text("Test"),],),color:Colors.transparent,elevation:0,splashColor:Colors.transparent,//onPressed:(){//Navigator.push(context,MaterialPageRoute(bu

flutter - 如何在几秒钟后返回一个小部件?

returnContainer(color:Colors.transparent,child:Column(children:[Container(color:Colors.transparent,height:30,child:RaisedButton(child:Column(children:[Text("Test"),],),color:Colors.transparent,elevation:0,splashColor:Colors.transparent,//onPressed:(){//Navigator.push(context,MaterialPageRoute(bu

flutter - 如何在 Dart flutter 中创建回调函数?

我有这个带有onTap参数的方法myFunc({onTap}){returnonTap;}那么,我需要这样使用它myFunc(onTap:print('loremipsum');)我怎样才能正确地做到这一点?谢谢 最佳答案 你可以像下面那样做。请注意,您可以指定参数或避免,我添加了Function(您可以使用ValueChange,Voidcallback)myFunc({FunctiononTap}){onTap();}//invokemyFunc(onTap:(){});如果你想传递参数:myFunc({FunctiononTa

flutter - 如何在 Dart flutter 中创建回调函数?

我有这个带有onTap参数的方法myFunc({onTap}){returnonTap;}那么,我需要这样使用它myFunc(onTap:print('loremipsum');)我怎样才能正确地做到这一点?谢谢 最佳答案 你可以像下面那样做。请注意,您可以指定参数或避免,我添加了Function(您可以使用ValueChange,Voidcallback)myFunc({FunctiononTap}){onTap();}//invokemyFunc(onTap:(){});如果你想传递参数:myFunc({FunctiononTa

json - Flutter 如何根据 JSON API 的状态更改颜色

我想根据JSONAPI中的状态动态更改框颜色。例如,批准=Colors.green,拒绝=Colors.red,提交=Colors.blue。thisistheimageofmycurrentapp我在状态下划线如何实现?这是我获取API的方式:FuturegetCalendar()async{Listlist;Stringapi="http://200.0.0.104/api/dynamic/uspGetCalendarEvents_mobile?EmployeeId=5";varres=awaithttp.get(Uri.encodeFull(api),headers:{"Acce

json - Flutter 如何根据 JSON API 的状态更改颜色

我想根据JSONAPI中的状态动态更改框颜色。例如,批准=Colors.green,拒绝=Colors.red,提交=Colors.blue。thisistheimageofmycurrentapp我在状态下划线如何实现?这是我获取API的方式:FuturegetCalendar()async{Listlist;Stringapi="http://200.0.0.104/api/dynamic/uspGetCalendarEvents_mobile?EmployeeId=5";varres=awaithttp.get(Uri.encodeFull(api),headers:{"Acce

forms - Flutter - 使用子 map 属性发送表单帖子

我正在尝试以以下JSON格式发送POST请求,但是,由于Http包不接受dynamic作为值,我收到下面列出的错误。有什么建议可以在Flutter中解决这个问题吗?{"username":"john","password":"XXXX","deviceName":"XXX","attributes":{"deviceName":"iPhoneXʀ","deviceVersion":"12.2","identifier":"XXX","notificationToken":"XXX","os":"XXX"}}错误信息:UnhandledException:type'_InternalLi

forms - Flutter - 使用子 map 属性发送表单帖子

我正在尝试以以下JSON格式发送POST请求,但是,由于Http包不接受dynamic作为值,我收到下面列出的错误。有什么建议可以在Flutter中解决这个问题吗?{"username":"john","password":"XXXX","deviceName":"XXX","attributes":{"deviceName":"iPhoneXʀ","deviceVersion":"12.2","identifier":"XXX","notificationToken":"XXX","os":"XXX"}}错误信息:UnhandledException:type'_InternalLi

flutter - 在 flutter 中如何根据登录用户的类型导航到特定主页?

我的应用程序要求包含两种类型的用户。一种类型的用户(user_1)可以在登录后访问表单页面,而第二种类型(admin)的用户将可以访问user_1填写的表单?两个用户的登录屏幕是相同的。根据登录凭据,将决定是浏览user_1页面还是管理页面。如何在flutter中解决这个问题?要为不同的用户导航到不同的主页? 最佳答案 我也有同样的事情要做。我使用共享首选项来了解此人是谁(在您的情况下是否为管理员)。共享首选项是一种持久且安全的数据存储方式。Here插件页面。在我的初始化页面中,我检查共享首选项并根据结果重定向到该页面。///You

flutter - 在 flutter 中如何根据登录用户的类型导航到特定主页?

我的应用程序要求包含两种类型的用户。一种类型的用户(user_1)可以在登录后访问表单页面,而第二种类型(admin)的用户将可以访问user_1填写的表单?两个用户的登录屏幕是相同的。根据登录凭据,将决定是浏览user_1页面还是管理页面。如何在flutter中解决这个问题?要为不同的用户导航到不同的主页? 最佳答案 我也有同样的事情要做。我使用共享首选项来了解此人是谁(在您的情况下是否为管理员)。共享首选项是一种持久且安全的数据存储方式。Here插件页面。在我的初始化页面中,我检查共享首选项并根据结果重定向到该页面。///You