作者热门文章
- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我尝试使用 flutter 创建登录屏幕,在那里我添加了记住我复选框,但我无法正确对齐它,
Flutter 复选框在其周围占据了不需要的空间,以提供良好的触摸用户体验。
这是我的布局显示方式,
检查下面的代码,
new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
new Row(
children: <Widget>[
new Checkbox(
activeColor: Colors.grey,
value: _isChecked,
onChanged: (bool value) {
_onChecked(value);
},
),
new GestureDetector(
onTap: () => print("Remember me"),
child: new Text(
"Remember me",
style: new TextStyle(color: Colors.white70),
),
)
],
),
new Text(
"Forgot password ?",
style: new TextStyle(color: Colors.white70),
)
],
),
最佳答案
使用 SizedBox
该小部件基本上是为调整其子级大小而设计的。
SizedBox(
width: 15,
height: 15,
child: Checkbox(value: false, onChanged: null)
)
关于checkbox - flutter 复选框不需要的触摸空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50486675/
我是一名优秀的程序员,十分优秀!