1.ChoiceChip
ChoiceChip 选择控件,可以实现单选效果
先看对应的属性
const ChoiceChip({
Key key,
this.avatar, //左侧Widget 一般小图标
@required this.label, //标签文字
this.labelStyle, //标签文字的样式
this.labelPadding,
this.onSelected,
this.pressElevation,
@required this.selected, //是否选中
this.selectedColor, //选择的颜色
this.disabledColor, //不可用的颜色
this.tooltip,
this.shape, //shape 默认是两端半圆形
this.clipBehavior = Clip.none,
this.backgroundColor, //背景色
this.padding,
//设置为MaterialTapTargetSize.shrinkWrap时
//,clip距顶部距离为0;设置为MaterialTapTarget
//Size.padded时距顶部有一个距离
this.materialTapTargetSize,
this.elevation,
this.shadowColor,//阴影背景色
this.selectedShadowColor,//选中的阴影背景色
this.avatarBorder = const CircleBorder(),
})
复制代码
默认的情况下,ChoiceChip 选择主要是修改背景色以及对应的文字,