【发布时间】:2019-08-05 17:28:34
【问题描述】:
所以这看起来很基本,但我无法弄清楚。我有一个 ListTile,它有一个前导复选框、一个标题和一个尾随图标。在上次 Flutter 更新中,由于某种原因,复选框和图标不再居中。我希望它们垂直居中。我尝试以各种方式将 Center()、Align()、Expanded() 和 Flexible() 添加到复选框,但它只是将标题推离屏幕或什么都不做。
有什么建议吗?任何帮助表示赞赏。
ListTile(
leading: Checkbox(
value: item.checked,
onChanged: (bool newValue) {
setState(() {
item.checked = newValue;
});
firestoreUtil.updateList(user, taskList);
},
activeColor: Theme.of(context).primaryColor,
),
title: InkWell(
onTap: () {
editTask(item);
},
child: Text(
item.task,
style: TextStyle(fontSize: 18),
)),
trailing: ReorderableListener(
child: Container(
padding: EdgeInsets.only(right: 16),
child: Icon(Icons.drag_handle)),
),
contentPadding: EdgeInsets.all(8),
),
【问题讨论】: