美文网首页flutter
Flutter之Chip组件

Flutter之Chip组件

作者: 习惯了_就好 | 来源:发表于2019-01-03 15:45 被阅读72次
    /**
     * 碎片,一般是用作标签
        const Chip({
        Key key,
        this.avatar,//标签左侧Widget,一般为小图标
        @required this.label,//标签
        this.labelStyle,
        this.labelPadding,
        this.deleteIcon,//删除图标
        this.onDeleted,//删除回调,为空时不显示删除图标
        this.deleteIconColor,//删除图标的颜
        this.deleteButtonTooltipMessage,//删除按钮的tip文字
        this.shape,//形状.默认两端是半圆形
        this.clipBehavior = Clip.none
        this.backgroundColor,//背景颜色
        this.padding,
        this.materialTapTargetSize,//设置为MaterialTapTargetSize.shrinkWrap时,clip距顶部距离为0;设置为MaterialTapTargetSize.padded时距顶部有一个距离
        })
     */
    
    body: Chip(
              label: Text("chip组件", style: TextStyle(fontSize: 15.0,
                  color: Color(0xff333333),
                  fontStyle: FontStyle.italic),),
              labelPadding: EdgeInsets.only(left: 3.0),
              avatar: Icon(Icons.home, color: Color(0xff00ff00),),
              onDeleted: () {},
              deleteIcon: Icon(Icons.delete),
              deleteIconColor: Color(0xffff0000),
              deleteButtonTooltipMessage: "手下留情",
              backgroundColor: Color(0xfff1f1f1),
    
              shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(5.0)
              ),
    
              materialTapTargetSize: MaterialTapTargetSize.padded,
            ),
    

    相关文章

      网友评论

        本文标题:Flutter之Chip组件

        本文链接:https://www.haomeiwen.com/subject/bcafrqtx.html