ElevatedButton 클릭되었을때 행동할 행위를 구현해서 사용이가능하다.
//버튼관련
body: Column(
children: [
Container(
margin: EdgeInsets.all(32),
width: 200,
height: 70,
child: ElevatedButton(
onPressed: () {
// 클릭 했을때 동작하고 싶은 내용을 만든다.
print('버튼이 클릭되었습니다.');
},
style: ElevatedButton.styleFrom(
primary: Colors.green,
onPrimary: Colors.yellow,
elevation: 10//높이 z축에 약간의 그림자 형태를 가능하게한다.
),
child: Text('눌러보세요')),
)
],
),
반응형
'Flutter' 카테고리의 다른 글
[Flutter] TextField 입력필드 위젯 (0) | 2023.12.31 |
---|---|
[Flutter] ListView 위젯 (0) | 2023.12.15 |
[Flutter] Text, Image, Icon 위젯 (0) | 2023.12.09 |
[Flutter]Container, SizedBox 위젯 사용법 (0) | 2023.12.09 |
[Flutter] Column, Row, Expanded 위젯 (0) | 2023.12.09 |