小工具知识网

当前位置: 首页 > 行业知识 > Flutter开发之——交互组件-Checkbox和CheckboxListTile(1)

行业知识

Flutter开发之——交互组件-Checkbox和CheckboxListTile(1)

2026-11-09 09:50:26 来源:互联网转载

本文介绍Flutter中的复选框组件

  • Checkbox是只有复选框的组件

  • CheckboxListTile是带有复选框和标题文字的组件

二 Checkbox


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 常用属性

| 属性 | 说明 | 取值 |

| :-: | :-: | :-:

上一篇:像素工厂服务器怎么开?

下一篇:宝塔面板怎么设置跳转?