與 ButtonStyle 部分苦苦掙扎。我想改變按鈕的高度。
style: ButtonStyle(
fixedSize: MaterialStateProperty.all(
Size.fromHeight(150),
),
),
注意:我不想使用 .styleFrom
uj5u.com熱心網友回復:
用 SizedBox 包裝一個小部件將使它的高度和寬度給定。
SizedBox(
height: 200,
child: ElevatedButton(
child: Text('something'),
onPressed: () {},
),
)
uj5u.com熱心網友回復:
我想到了:
style: ButtonStyle(
fixedSize:
MaterialStateProperty.all(const Size(80, 80)),
),
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/360798.html
上一篇:如何在flutter默認應用欄后退按鈕上使用splashFactory:NoSplash.splashFactory?
