本文介绍Flutter中的复选框组件
-
Checkbox是只有复选框的组件
-
CheckboxListTile是带有复选框和标题文字的组件
2.1 构造方法
const Checkbox({
Key? key,
required this.value,
this.tristate = false,
required this.onChanged,
this.mouseCursor,
this.activeColor,
this.fillColor,
this.checkColor,
this.focusColor,
this.hoverColor,
this.overlayColor,
this.splashRadius,
this.materialTapTargetSize,
this.visualDensity,
this.focusNode,
this.autofocus = false,
}) : assert(tristate != null),
assert(tristate || value != null),
assert(autofocus != null),
super(key: key);
2.2 常用属性
| 属性 | 说明 | 取值 |
| :-: | :-: | :-: