
저는 처음에 Padding을 사용하였습니다.
예를 들어,
이름: _________
라고 되어 있으면 오른쪽에 padding 값을 부여해서 크기를 조절할 수 있었어요.
근데 이렇게하면 사용자의 핸드폰 화면 크기에 따라 여백 공간 간격이 달라져서 텍스트필드 입력 칸이 좁아지거나 사라지는 오류가 나더라고요.
그래서 저는 padding이 아닌, Container로 텍스트필드 크기를 수정해줬습니다.
Container(
child: new Flexible(
child: new TextField(
controller: name,
style: Theme.of(context).textTheme.bodyText1,
),
),
),
Container(
child: new Flexible(
child: new TextField(
controller: name,
style: Theme.of(context).textTheme.bodyText1,
),
),
width: 150, //TextField 크기
),
width에 써준 값에 따라 TextField 입력칸의 크기가 달라집니다.
=====================================================
Row(
children: <Widget>[
SizedBox(width: 41,),
new Text(
"이름",
textAlign: TextAlign.left,
style: TextStyle(fontFamily: 'jua', fontSize: 20),
),
SizedBox(width: 40,),
Container(
child: new Flexible(
child: new TextField(
controller: name,
style: Theme.of(context).textTheme.bodyText1,
),
),
width: 150, //TextField 크기
),
],
),
