[英]Creating tick box in Flutter
How to create such kind of thing in Flutter with possibility of putting a tick?如何在 Flutter 中创建这种可以打勾的东西?
This kind of thing is called a Checkbox
, and like most things, Flutter has a Widget
for that.这种东西叫做
Checkbox
,和大多数东西一样,Flutter 有一个Widget
来做。
It's called Checkbox
and the Flutter Team has a full live example of how it's used, go to their docs to find out more!它被称为
Checkbox
,Flutter 团队有一个完整的使用示例,请访问他们的文档以了解更多信息!
you can use widget called CheckBox
and use shape
property to make it round您可以使用名为
CheckBox
小部件并使用shape
属性使其变圆
Checkbox(
checkColor: Colors.white,
fillColor: MaterialStateProperty.resolveWith(getColor),
value: isChecked,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2)),
onChanged: (bool? value) {
setState(() {
isChecked = value!;
});
},
);
here you can check more about Checkbox
在这里您可以查看有关
Checkbox
更多信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.