一 ElevatedButton
即"漂浮"按鈕闷煤,它默認(rèn)帶有陰影和灰色背景童芹。按下后,陰影會(huì)變大
ElevatedButton(onPressed: (){
print('dffdff');
}, child: Text('正常')
),
截屏2023-06-28 11.44.23.png
二 TextButton 文本按鈕
文本按鈕曹傀,默認(rèn)背景透明并不帶陰影辐脖。按下后,會(huì)有背景色
TextButton(
child: Text("normal"),
onPressed: () {},
)
截屏2023-06-28 11.47.41.png
三 OutlinedButton
默認(rèn)有一個(gè)邊框皆愉,不帶陰影且背景透明嗜价。按下后,邊框顏色會(huì)變亮幕庐、同時(shí)出現(xiàn)背景和陰影(較弱)
OutlinedButton(
child: Text("normal"),
onPressed: () {},
)
四
ElevatedButton久锥、TextButton、OutlinedButton都有一個(gè)icon 構(gòu)造函數(shù)异剥,通過(guò)它可以輕松創(chuàng)建帶圖標(biāo)的按鈕
ElevatedButton.icon(
icon: Icon(Icons.send),
label: Text("發(fā)送"),
onPressed: () {},
),