在SwitchListtile中,是否有任何方法可以将文本标签和切换元素相邻? (而不是在瓷砖空间的两端)
从文档中,请按照此link
,然后使用以下来更新行mainAxisAlignment: MainAxisAlignment.center, // Center the row contents
和ASizedBox
在某些空间
所以看起来应该像这样
Row(
mainAxisAlignment: MainAxisAlignment.center, // center contents
children: <Widget>[
Text(label),
const SizedBox(width: 8), // some spacing between text and switch
Switch(
value: value,
onChanged: (bool newValue) {
onChanged(newValue);
},
),
],
),