[英]How to change the checkBox color inside the checkBoxListTile in flutter?
[英]Flutter - how to change CheckboxListTile size?
不用擔心,最好使用 Transform.scale()。 它將幫助您通過縮放功能管理大小..
***下面的代碼***
Row(
children: [
Transform.scale(
scale: 1.3,
child: Checkbox(value: mail, onChanged: (value) {}),
),
Text(
"Recieve Mail",
style: TextStyle(fontSize: 18.0),
)
],
),
不確定我是否會在這里提供幫助,但看起來你是對的,即通過 CheckBoxListTile 小部件添加時無法更改 CheckBox 大小。
不過,您也可以通過為您使用的每個圖塊插入一個 Row 來創建自己的圖塊:
Row(
children: [
Icon(Icons.attach_money),
Text("Sinal"),
Transform(
transform: myTransform, // I don't remember the correct syntax for this one
child: Checkbox(
value: true,
onChanged: (_) {},
),
),
]
),
您唯一需要添加的是根據設備動態更改圖標、文本和復選框的大小。 (您可以使用MediaQuery.of(context).size來實現這一點)
return Scaffold(
body: Container(
width: size.width,
height: size.height,
child: Center(
child: new StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return new Transform.scale(
scale: 1.2,
child: Checkbox(
value: isChecked,
onChanged: (bool? value) {
setState(() {
isChecked = value!;
});
},
),
);
},
),
),
),
);
您找到任何解決方案了嗎@Rafael Honda
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.