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

flutter创建不同样式的按钮,背景色,边框,圆角,圆形,大小都可以设置

在ui设计中,可能按钮会有不同的样式需要你来写出来,所以按钮的不同样式,应该是最基础的功能,在这里我们赶紧学起来吧,web端可能展示有问题,需要优化,但是基本样式还是出来了

我是将所有的按钮放在了Column中: 

Column(children: [ElevatedButton(onPressed: () {},child: Text("红色按钮"),style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.red),foregroundColor: MaterialStateProperty.all(Colors.black),),),OutlinedButton(onPressed: () {}, child: Text("边框按钮")),ElevatedButton(onPressed: () {},child: Text("圆角"),style: ButtonStyle(shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)))),),ElevatedButton(onPressed: () {},child: Text("圆形"),style: ButtonStyle(shape: MaterialStateProperty.all(CircleBorder())),),//   大一点的按钮Container(width: 90,height: 60,margin: EdgeInsets.only(bottom: 10),child: ElevatedButton(child: Text("大按钮"),onPressed: () {},),),//   大圆形按钮SizedBox(width: 90,height: 60,child: ElevatedButton(onPressed: () {},child: Text("大圆形"),style: ButtonStyle(shape: MaterialStateProperty.all(CircleBorder())),),)],)

http://www.lryc.cn/news/241255.html

相关文章:

  • 【C++】标准模板库STL作业(其二)
  • 基于SpringBoot+Redis实现点赞/排行榜功能,可同理实现收藏/关注功能,可拓展实现共同好友/共同关注/关注推送功能
  • AI“胡说八道”?怎么解?
  • [SIGGRAPH-23] 3D Gaussian Splatting for Real-Time Radiance Field Rendering
  • 大话设计模式C++实现
  • IT 领域中的主要自动化趋势
  • 使用Python解析CAN总线
  • DevExpress中文教程 - 如何在macOS和Linux (CTP)上创建、修改报表(下)
  • RAID的应用场景以及优缺点
  • java SpringCloud版本b2b2c鸿鹄云商平台全套解决方案 小程序商城免费搭建
  • [Linux] shell脚本的函数和数组
  • 万宾科技智能井盖的效果怎么样?
  • nvm切换版本之后npm用不了
  • 【elementui】el-popover在列表里循环使用,取消的doClose无效解决办法
  • 【php】解决加载速度慢导出超时问题记录
  • postgresql安装fdw扩展
  • 反爬虫机制与反爬虫技术(二)
  • Grails 启动
  • 2023年亚太地区数学建模大赛 问题A
  • 基于springboot实现校园在线拍卖系统项目【项目源码】
  • 详解ES6的Promise
  • 多语言快速排序算法
  • opencv-图像梯度
  • linux centos7 安装nginx
  • Xilinx Zynq-7000系列FPGA实现视频拼接显示,提供两套工程源码和技术支持
  • DAOS低时延与高性能RDMA网络
  • 城市管理实景三维:打造智慧城市的新引擎
  • Python3.11+Pyside6开发电影下载程序
  • HCIP-七、IS-IS 综合实验
  • 广西桂林钢结构钣金折弯件3d扫描全尺寸偏差检测-CASAIM中科广电