TextField
글자를 입력받는 위젯이다. InputDecoration 클래스와 함께 사용하면 힌트 메세지나 외곽선 등의 꾸밈 효과를 낼 수 있다.
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('TextField'),
),
body: Container(
padding: EdgeInsets.all(20.0), // 패딩안주니 보더가 안보여서 패딩줌
child: TextField(
decoration: InputDecoration(
border: OutlineInputBorder(), // 외곽선
labelText: '여기입력', //힌트
),
),
));
}
}
'백엔드개발자 > FLUTTER, DART' 카테고리의 다른 글
[Flutter] 간단한 카운트앱 이애오 (0) | 2022.06.30 |
---|---|
[Flutter] 화면 이동 Navigator(push, pop)과 데이터 전달 (0) | 2022.06.30 |
[Flutter] Align, Expanded (0) | 2022.06.27 |
[Flutter] AppBar, TabBar, Tab, TabBarView, bottomNavigationBar (0) | 2022.06.27 |
[Flutter] ListView, ListTile, scrollDirection, GridView, PageView, Padding (0) | 2022.06.26 |