1. Checkbox
const Checkbox({
Key key,
@required this.value,
this.tristate = false,
@required this.onChanged,
this.mouseCursor,
this.activeColor,
this.checkColor,
this.focusColor,
this.hoverColor,
this.materialTapTargetSize,
this.visualDensity,
this.focusNode,
this.autofocus = false,
})
1.1 Checkbox范例
// 代码块
Widget build(BuildContext context) {
return Checkbox(
value: true,
onChanged: (value) {
print('click-checkbox: $value');
},
);
}
// 简约
Widget build(BuildContext context) {
return Checkbox(
value: true, onChanged: (value) => print('click-checkbox: $value'));
}