ElevatedButton(onPressed: () {}, child: Text('ElevatedButton')),
OutlinedButton(onPressed: () {}, child: Text('OutlinedButton')),
TextButton(onPressed: () {}, child: Text('TextButton')),
IconButton(onPressed: () {}, icon: Icon(Icons.star)),
각 버튼은 onPressed를 통해 버튼이 눌렸을 때 수행할 일에 대한 함수를 인자로 받음
각 버튼 위젯 내에 style을 사용해 버튼을 꾸밀 수가 있다.
// 배경 색 변경
backgroundColor: Colors.red
// 버튼 내 텍스트 색상 변경
foregroundColor: Colors.yellow
// 버튼 모서리 각지게 만들기
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
shape: WidgetStateProperty(RoundedRectangleBorder()),
),
),
이외에도 많은 옵션들이 있으니 공식문서를 참고하자!