728x90
반응형
TextFormField 를 위젯들로 감싸준다.
padding > safeArea > SingleChildScrollView
@override
Widget build(BuildContext context) {
return DefaultLayout(
child: SingleChildScrollView(
// 키보드 사용 시 화면 드래그 하면 해제
keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
child: SafeArea(
bottom: false, // 하단 여백 미사용
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'앱 연습',
style: TextStyle(
fontSize: 50.0,
fontWeight: FontWeight.w700,
),
),
const SizedBox(height: 16,),
CustomTextFormField(
onChanged: (String value) {},
hintText: '아이디 입력',
),
const SizedBox(height: 16,),
CustomTextFormField(
onChanged: (String value) {},
hintText: '비밀번호 입력',
obscureText: true,
),
],
),
),
),
),
);
}
728x90
반응형