return Scaffold(
body: Center(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
color: Colors.red,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: Center(
child: SelectGroupCard(context, titles: titles, ids: ids,
onTap: (title, id) {
setState(() {
cardGroupResult = title " " id;
});
}),
),
),
],
),

如圖所示,有幾張卡片。我想把這些弄出來。我什至希望能夠在頁面中間以 3 列 4 行的形式顯示這些卡片。
uj5u.com熱心網友回復:
使用小部件GridView,它允許您選擇所需的列數和行數。此外,還可以安裝襯墊。
uj5u.com熱心網友回復:
你可以使用 GridView
GridView(
gridDelegate:const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, // you can change this
),
children :[...] // put your cards here !
)
uj5u.com熱心網友回復:
您可以洗掉 SelectGroupCard 的寬度屬性。例如,如果 SelectGroupCard 是一個行小部件,下面的代碼是這樣的:
Row(
mainAxisSize: MainAxisSize.min,
children: [],
)
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/530607.html
標籤:扑镖
