当前位置: 首页 > news >正文

解决flutter showDialog下拉框,复选框等无法及时响应的问题

使用StatefulBuilder

  _showDialogr() {showDialog(context: context,builder: (BuildContext ctx) {return StatefulBuilder(builder: (BuildContext context, StateSetter setState) {return Scaffold(body: Column(children: <Widget>[Container(height: 400,padding: EdgeInsets.fromLTRB(8, 0, 8, 8),decoration: BoxDecoration(borderRadius: BorderRadius.circular(20),color: Colors.white,),child: Column(mainAxisSize: MainAxisSize.min,children: <Widget>[SizedBox(height: 15,),Expanded(flex: 6,child: Column(mainAxisSize: MainAxisSize.min,children: <Widget>[Row(children: [Expanded(flex: 8,child: DropdownButton<String>(items: getList(),hint: Text('请选择'),value: Id,onChanged: (String? str) {setState(() {Id = str;});},elevation: 24,style: TextStyle(color: Colors.black,fontSize: 16,),),),],),],),),],),),],),);},);},);}
http://www.lryc.cn/news/124795.html

相关文章:

  • [C++ 网络协议编程] UDP协议
  • reactNative跳转appstore链接报错:Redirection to URL with a scheme that is not HTTP(S)
  • html css实现爱心
  • react中使用shouldComponentUpdate生命周期函数调用setState引起的无限循环的错误
  • 麦肯锡发布《2023科技趋势展望报告》,生成式AI、下一代软件开发成为趋势,软件测试如何贴合趋势?
  • 【爬虫】P1 对目标网站的背景调研(robot.txt,advanced_search,builtwith,whois)
  • maven如何建立JavaWeb项目并连接数据库,验证登录
  • CVPR 2023 | 用户可控的条件图像到视频生成方法(基于Diffusion)
  • 动态规划(基础)
  • 【Pytorch:nn.Embedding】简介以及使用方法:用于生成固定数量的具有指定维度的嵌入向量embedding vector
  • 动态库的命名规则
  • 【Linux】网络---->网络理论
  • Android学习之路(4) UI控件之输入框
  • 1.初识Web
  • 【微服务技术一】Eureka、Nacos、Ribbon(配置管理、注册中心、负载均衡)
  • 【Linux】可重入函数 volatile关键字 以及SIGCHLD信号
  • 【动态规划】回文串问题
  • Laravel Swift Mail发送带附件的邮件报错 “Swift_IoException The path cannot be empty“处理
  • Linux下常见的代理服务器软件介绍
  • SCSS的基本用法
  • alertmanager创建nginx-ingress basic auth鉴权
  • 系列六、Redis中的五大数据类型及相关操作
  • 四大运营商的大流量卡测评,看完您会选哪个运营商?
  • Apache-Maven
  • 什么是原子交换?
  • java springboot word文档转pdf
  • 【Leetcode Sheet】Weekly Practice 2
  • 【BERTopic应用 03/3】:微调参数
  • 2023年上半年数学建模竞赛题目汇总与难度分析
  • Linux下搭建java环境