【Flutter2】ElevatedButton과 TextButton의 디자인 12종류를 정리해 소개!
1. 배경에 색칠하기

ElevatedButton(
onPressed: () {},
child: Text(
"背景",
),
style: ElevatedButton.styleFrom(
primary: Colors.red,
),
2. 아이콘이 있는 버튼

ElevatedButton.icon(
onPressed: () {},
label: Text('アイコン'),
icon: Icon(Icons.star),
),
3. 비활성 버튼

ElevatedButton(
onPressed: null,
child: Text('押せないボタン'),
),
4. 요코마루 버튼

ElevatedButton(
onPressed: () {},
child: Text('横丸ボタン'),
style: ElevatedButton.styleFrom(
shape: StadiumBorder(),
),
),
5. 크기가 큰 버튼

ElevatedButton(
onPressed: () {},
child: Text('大きいボタン'),
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.all(30)),
textStyle: MaterialStateProperty.all(TextStyle(fontSize: 25)),
),
),
6. 그림자가 있는 버튼

ElevatedButton(
onPressed: () {},
child: Text('影付きボタン'),
style: ElevatedButton.styleFrom(elevation: 10),
),
7. 둥근 버튼

ElevatedButton(
onPressed: () {},
child: Text('丸'),
style: ElevatedButton.styleFrom(shape: CircleBorder()),
),
8. 외부 프레임이 있는 버튼

ElevatedButton(
onPressed: () {},
child: Text(
"外枠",
style: TextStyle(color: Colors.blue),
),
style: ElevatedButton.styleFrom(
primary: Colors.white,
side: BorderSide(
color: Colors.blue,
width: 2,
),
),
),
9.외부 테두리가 있는 가로 원 버튼

ElevatedButton(
onPressed: () {},
child: Text(
"外枠付き横丸",
style: TextStyle(color: Colors.blue),
),
style: ElevatedButton.styleFrom(
shape: StadiumBorder(),
primary: Colors.white,
side: BorderSide(
color: Colors.blue,
width: 2,
),
),
),
10. 문자 버튼

TextButton(
onPressed: () {},
child: Text('文字ボタン'),
style: ButtonStyle(
foregroundColor:
MaterialStateProperty.all<Color>(Colors.blue),
),
),
11. 외부 프레임이 있는 문자 버튼

OutlinedButton(
onPressed: () {},
child: Text('外枠付き文字ボタン'),
style: OutlinedButton.styleFrom(
side: BorderSide(width: 2, color: Colors.blue),
),
),
12. 요코마루 문자 버튼

OutlinedButton(
onPressed: () {},
child: Text('横丸文字ボタン'),
style: OutlinedButton.styleFrom(
shape: StadiumBorder(),
side: BorderSide(width: 2, color: Colors.blue),
),
),
Reference
이 문제에 관하여(【Flutter2】ElevatedButton과 TextButton의 디자인 12종류를 정리해 소개!), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/NaokiKotani/items/4c6917157517d15ca21a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)