前端学习-flutter学习-010-按钮

《Flutter实战·第二版》

ElevatedButton(
    child: Text("ElevatedButton 默认带有阴影和灰色背景。按下后,阴影会变大"),
    onPressed: () {},
  ),
  TextButton(
    child: Text("TextButton 默认背景透明并不带阴影。按下后,会有背景色"),
    onPressed: () {},
  ),
  OutlinedButton(
    child: Text("OutlinedButton 默认有一个边框,不带阴影且背景透明。按下后,边框颜色会变亮、同时出现背景和阴影(较弱)"),
    onPressed: () {},
  ),
  IconButton(
    icon: Icon(Icons.thumb_up),
    onPressed: () {},
  ), // IconButton是一个可点击的Icon,不包括文字,默认没有背景,点击后会出现背景
  // ElevatedButton、TextButton、OutlinedButton都有一个icon 构造函数,通过它可以轻松创建带图标的按钮,
  ElevatedButton.icon(
    icon: Icon(Icons.send),
    label: Text("发送"),
    onPressed: () {},
  ),
  OutlinedButton.icon(
    icon: Icon(Icons.add),
    label: Text("添加"),
    onPressed: () {},
  ),
  TextButton.icon(
    icon: Icon(Icons.info),
    label: Text("详情"),
    onPressed: () {},
  ),
posted @   ayubene  阅读(10)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
· SQL Server 2025 AI相关能力初探
· 为什么 退出登录 或 修改密码 无法使 token 失效
点击右上角即可分享
微信分享提示