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

企业网站建设进什么科目核算泉州建站方案

企业网站建设进什么科目核算,泉州建站方案,个人网站建设作用,建设部设计规范网站前言 现在有个需求,需要用底部弹窗来添加定时的重复。在这里使用原生的showModalBottomSheet来实现 showModalBottomSheet的Props 名称 描述 isScrollControlled全屏还是半屏isDismissible外部是否可以点击,false不可以点击,true可以点击&a…

前言

现在有个需求,需要用底部弹窗来添加定时的重复。在这里使用原生的showModalBottomSheet来实现

showModalBottomSheet的Props

名称

描述

isScrollControlled全屏还是半屏
isDismissible外部是否可以点击,false不可以点击,true可以点击,点击后消失
backgroundColor背景色,通常可以设置白色和透明
barrierColor

设置遮挡底部的半透明颜色,默认是black54,可以设置成透明的;

置外部区域的颜色

enableDrag是否可以向下拖动关闭,默认是true打开的;
shapemodel边框样式
builder构造内容

关闭弹窗

Navigator.pop(context);

完整代码

showModalBottomSheet(context: context,backgroundColor: Colors.transparent,builder: (context) {return Container(height: 600.h,padding: EdgeInsets.symmetric(horizontal: 30.w),decoration: BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(30.w),topRight: Radius.circular(30.w),),color: Colors.white,),child: Column(children: [Container(height: 110.h,child: Center(child: Text("重复".tr,style: TextStyle(fontSize: 30.sp,fontWeight: FontWeight.bold,),),),),RepeatModelItem(title: "启动一次".tr,isSelect: repeatDate.isEmpty,onPressed: () {Navigator.pop(context);},),RepeatModelItem(title: "每天".tr,isSelect: repeatDate.length == 7,onPressed: () {Navigator.pop(context);},),RepeatModelItem(title: "自定义".tr,isSelect: repeatDate.isNotEmpty && repeatDate.length < 7,onPressed: () {Navigator.pop(context);},),Container(margin: EdgeInsets.only(top: 20.h),child: TextButton(onPressed: () {Navigator.pop(context);},child: Text("取消".tr),),)],),);},);

 但是此时遇到了一个问题,在底部选择中使用多选框的是否不能选中

解决办法

使用StatefulBuilder实现局部刷新

showModalBottomSheet(isScrollControlled: true,context: context,backgroundColor: Colors.transparent,builder: (context) {//因为组件中用了多选框,要使多选框点击生效,所以这里使用了StatefulBuilder,实现局部刷新return StatefulBuilder(//弹窗内容builder: (context, setState) {return Container(height: 1050.h,padding: EdgeInsets.symmetric(horizontal: 30.w),decoration: BoxDecoration(borderRadius: BorderRadius.only(topLeft: Radius.circular(30.w),topRight: Radius.circular(30.w),),color: Colors.white,),child: Column(children: [// 标题SizedBox(height: 110.h,child: Center(child: Text("自定义".tr,style: TextStyle(fontSize: 30.sp,fontWeight: FontWeight.bold,),),),),RepeatModelItem(title: "周一".tr,isSelect: customrepeatDate[0] == 1,onPressed: () {setState(() {customrepeatDate[0] = customrepeatDate[0] == 1 ? 0 : 1;});},),RepeatModelItem(title: "周二".tr,isSelect: customrepeatDate[1] == 1,onPressed: () {setState(() {customrepeatDate[1] = customrepeatDate[1] == 1 ? 0 : 1;});},),RepeatModelItem(title: "周三".tr,isSelect: customrepeatDate[2] == 1,onPressed: () {setState(() {customrepeatDate[2] = customrepeatDate[2] == 1 ? 0 : 1;});},),RepeatModelItem(title: "周四".tr,isSelect: customrepeatDate[3] == 1,onPressed: () {setState(() {customrepeatDate[3] = customrepeatDate[3] == 1 ? 0 : 1;});},),RepeatModelItem(title: "周五".tr,isSelect: customrepeatDate[4] == 1,onPressed: () {setState(() {customrepeatDate[4] = customrepeatDate[4] == 1 ? 0 : 1;});},),RepeatModelItem(title: "周六".tr,isSelect: customrepeatDate[5] == 1,onPressed: () {setState(() {customrepeatDate[5] = customrepeatDate[5] == 1 ? 0 : 1;});},),RepeatModelItem(title: "周日".tr,isSelect: customrepeatDate[6] == 1,onPressed: () {setState(() {customrepeatDate[6] = customrepeatDate[6] == 1 ? 0 : 1;});},),// 取消、确定按钮Container(margin: EdgeInsets.only(top: 20.h),child: Row(mainAxisAlignment: MainAxisAlignment.spaceAround,children: [// 取消按钮TextButton(style: TextButton.styleFrom(minimumSize: Size(300.w, 80.h),),onPressed: () {setState(() {customrepeatDate =setcustomrepeatDate(repeatDate);});Navigator.pop(context);},child: Text("取消".tr),),// 确定按钮TextButton(style: TextButton.styleFrom(minimumSize: Size(300.w, 80.h),),onPressed: () {var repeatDate1 = [];for (var i = 0; i < 7; i++) {if (customrepeatDate[i] == 1) {repeatDate1.add(i + 1);}}// setState(() {//   repeatDate = repeatDate1;// });//用上面的方法我更新不了repeatDate数据,于是我将更新放在外面了,可能是setState是StatefulBuilder的setRepeatDate(repeatDate1);Navigator.pop(context);},child: Text("确定".tr),),],),)],),);},);},);

http://www.yayakq.cn/news/695717/

相关文章:

  • 积极做好门户网站建设工作网站地址和网页地址区别
  • 企业建设网站的步骤是什么?wordpress主题简约博客
  • 深圳建设网站seo 手机如何开展一个网络营销活动
  • 企业建设网站公司排名社区门户网站建设方案
  • 太原智能化营销网站制作公司外汇网站源码 asp
  • 做网站要多少的分辨率赣州网站设计较好的公司
  • 正规网站建设推荐美妆网站设计
  • 黑龙江生产建设兵团知识网站网站建设中故障分类和排除方法
  • 信用卡网站模板营销方案现金充值什么意思
  • 文化建设五大工程天津网站优化怎么样
  • 如果搭建网站带你做网站毕设
  • 北京和田合瑞建设有限公司网站一个网站的成本
  • 网站开发的功能需求和模块划分赣州智美互联网科技有限公司
  • 济南营销型网站建设贵吗wordpress首页
  • 个人网站做淘宝客会怎样富阳营销型网站建设
  • 东莞网站建设推广方案免费爱做网站
  • 梅州英文网站建设网站搭建是什么专业
  • 大型网站后台登录地址一般是如何设置的wordpress主题瀑布流
  • 潍坊住房和城乡建设厅网站旅游开发 网站建设
  • 营销培训心得通州优化公司
  • 珠海网站策划摄影网站建立
  • 大连网站建设 选领超科技建设网站的目标客户群
  • 石家庄网站建设销售电话wordpress极简杂志主题
  • 电子兼职网站建设赣州优化公司
  • 网站开发摊销游戏公司网站模板下载
  • 触摸屏网站开发wordpress网站加载慢
  • 网站建设 说明西樵网站设计制作
  • 可信赖的武进网站建设河北手机网站制作多少钱
  • 如何从建设局网站上更换职称人员微信短网址在线生成
  • 装修高端网站建设织梦示范网站