Flutter set height of TextField

Coding Sweet·2022년 12월 19일

Flutter

목록 보기
1/1

TextField 높이를 변경하는 방법에 대해 알아보자

아래는 예제 코드이다.

minLines: null,
maxLines: null,
expands: true,
decoration: InputDecoration(
            filled: false,
            constraints: BoxConstraints(minHeight: proportionateHeight(216), maxHeight: proportionateHeight(216),),
)

기본 셋팅으로

minLines: null,
maxLines: null,
expands: true 

해당 옵션을 넣어줘야 높이 변경이 가능하다.

다음으로는 decoration에 아래와 같이 코드를 추가해보자

InputDecoration(
            filled: false,
            constraints: BoxConstraints(minHeight: proportionateHeight(216), maxHeight: proportionateHeight(216))
)

잘 동작 할 것이다.

profile
Sweet Coding

0개의 댓글