- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在像这样使用 CheckBoxListTile
,
CheckboxListTile(
title: Text(
ourAllnotes[i].note,
style: TextStyle(color: Colors.white),
),
value: false,
onChanged: (bool value) {},
activeColor: Colors.orange,
checkColor: Colors.white,
controlAffinity: ListTileControlAffinity.leading,
)
我可以在选中后更改复选框的颜色,但我无法在选中之前更改其颜色而不是其默认值。如何做到这一点?
最佳答案
尝试用 Theme 小部件包装 CheckBoxListTile
并在 unselectedWidgetColor
属性中选择颜色。
Theme(
data: ThemeData(unselectedWidgetColor: Colors.white),
child: CheckboxListTile(
checkColor: Colors.white,
title: Text(
"show password",
style: TextStyle(
fontSize: 12, color: Colors.white, letterSpacing: 2),
),
value: checkboxflag,
onChanged: (newValue) {
setState(() {
if (newValue) {
checkboxflag = newValue;
_obscureText = false;
} else {
checkboxflag = newValue;
_obscureText = true;
}
});
},
controlAffinity:
ListTileControlAffinity.leading, // <-- leading Checkbox
),
)
关于flutter - 如何在 flutter 中更改 checkBoxListTile 中的复选框颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64059629/
我不知道如何更改复选框边框的颜色并将文本移近。下面是我想要实现的代码和图像。 谢谢! CheckboxListTile( title: const Text('Re
void _onButtonPressd(BuildContext context) { TextEditingController customController = TextEditingC
我希望在我的 CheckboxListTiles 行周围删除此填充,但没有找到有关如何在不制作我自己的复选框版本的情况下执行此操作的任何信息。 有没有办法(使用CheckboxListTile): 去
使用带有编辑图标的 CheckboxListTile 小部件作为辅助小部件。 我希望能够编辑复选框列表中的每个项目。 !( https://ibb.co/m0Gc3Gx ) 添加功能以编辑 Check
不久,我需要可选区域的高度更小。 文本和复选框大小合适,但周围的框对于我要创建的 list 来说太大了。 CheckBoxListTile current height vs. desired hei
在下面的代码中,选择“选项 A”也会自动选择“选项 B”。 这段代码基本上是从 CheckboxListTile class documentation example 复制粘贴的,两次。 class
我已经设置了我的复选框小部件,并希望在选中时将勾选颜色更改为绿色(当前为白色)。所以我设法通过添加主题将未选中复选框的颜色更改为白色。我想将选定的刻度颜色更改为绿色,但我似乎无法在主题下找到正确的选项
我在标题标签中有一个 CheckboxListTile 和一个小部件。如何为此小部件创建 html 文本(文本 + url)? My text is: 'Hello Click here!' 我尝试过
我在标题标签中有一个 CheckboxListTile 和一个小部件。如何为此小部件创建 html 文本(文本 + url)? My text is: 'Hello Click here!' 我尝试过
我正在尝试使用 StreamBuilder 从在线服务器 Firebase 创建数据列表,但该复选框不会被选中。 我已使用 StreamBuilder 获取数据并使用 LisTile 小部件构建列表项
我正在像这样使用 CheckBoxListTile, CheckboxListTile( title: Text( ourAllnotes[i].n
我正在像这样使用 CheckBoxListTile, CheckboxListTile( title: Text( ourAllnotes[i].n
我是一名优秀的程序员,十分优秀!