Flutter中常用的按钮组件-IconButton(可点击的Icon)

 //IconButton 是Android风格的用于Icon的按钮,具有圆形范围的点击效果。默认没有背景,点击后会出现背景
            new IconButton(
              //icon 属性用于为 IconButton 指定一个图标,可以是图标,也可以是文字。
              // icon: new Text("data"),
              icon: new Icon(Icons.shopping_cart),
              //iconSize:属性用于指定图标的大小,默认值为 24。如果图标实际大小大于 iconSize,显示时会缩小 iconSize。否则,图标的显示大小不会改变。
              iconSize: 100,
              //color:属性指定启用 IconButton 时 IconButton 内图标的颜色
              color: Colors.teal,


              //disabledColor:属性指定禁用此 IconButton 时 IconButton 内图标的颜色。如果 onPressed 为 null 或未指定,则 IconButton 将被禁用
              disabledColor: Colors.black38,

              //splashColor:属性指定用户按下 IconButton 点周围的闪光的主要颜色。
              splashColor: Colors.amber,
              //splashRadius: 属性指定当用户按下 IconButton 时 IconButton 周围的闪光半径。它的默认值是 defaultSplashRadius (35)。
              splashRadius: 45,

              //highlightColor:splashColor 属性指定用户按下 IconButton 点周围的闪光灯的辅助颜色。
              highlightColor: Colors.blue,
              //onPressed:是一个回调函数,当用户单击 IconButton 时将调用该函数。如果未指定 onPressed,则 IconButton 将被禁用,这意味着当用户单击它时将没有响应。
              onPressed: (){},
              //tooltip:属性是 IconButton 的描述性文本。当用户单击此 IconButton 时,它就会出现。
              tooltip: "添加按钮",
            ),

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值