728x90
반응형
🙆♂️버튼의 종류
버튼의 종류로는
- TextButton()
- IconButton()
- ElevatedButton()
이 있습니다.
🙋♂️버튼 사용법
버튼들은 속성값으로 child와 onPressed를 꼭 넣어야 합니다.
그리고 onPressed를 통해서 click 되면 처리되는 함수를 넣습니다.
🚀TextButton()
TextButton은 말그대로 Text로 된 버튼입니다.
🚀ElevatedButton()
ElevatedButton이 우리가 알고 있는 버튼의 모습과 가깝습니다.
🚀IconButton()
IconButton은 아이콘으로 된 버튼입니다.
특이한 점은 속성값에 child가 아니라 icon으로 들어간다는 점입니다.
🤷♂️ 버튼 style
🚀ElevatedButton()
ElevatedButton은 style을 적용하기 위해서
style 속성에 ElevatedButton.styleFrom()을 작성하여 안에서 작성하게 됩니다.
배경색 변경은 color 속성도 아니고 backgroundColor 속성도 아닌 primary 속성으로 변경해야 합니다.
728x90
반응형
'앱 개발 > Flutter 공부' 카테고리의 다른 글
[Flutter] 숙제 2 (0) | 2022.06.29 |
---|---|
[Flutter] 09. AppBar 디자인 (0) | 2022.06.28 |
[Flutter] 07. 스타일 - Text, Icon (0) | 2022.06.28 |
[Flutter] 06. 박스 위치 정렬 - Center, Align (0) | 2022.06.28 |
[Flutter] 05. 박스 디자인 - decoration(border, border radius, box shadow) (0) | 2022.06.28 |