[보충]Form vs FormBuilder

Jooni·2020년 10월 28일
0

1. Form 이 있는데 FormBuilder API가 있는 이유?

1-1 Form 이란?

회원가입란이나 결제 UI등 여러가지의 정보들의 UI를 쉽게 만들 수 있게 하는 위젯.

Form Class

An optional container for grouping together multiple form field widgets (e.g. TextField widgets).
여러가지 FormField (예를들면 TextField)들을 한가지로 묶기위한 옵션이 많은 컨테이너다.
Each individual form field should be wrapped in a FormField widget, with the Form widget as a common ancestor of all of those.
각각의 FormField 위젯들은 Form형을 가진 FormField위젯으로 묶여야 한다. (뭐 대충 하나의 공통의 부모역할을 하는 폼 위젯으로 묶여야 한다고 하는거 같음.)
Call methods on FormState to save, reset, or validate each FormField that is a descendant of this Form.
Form상태를 저장, 갱신, 유효성검사(비밀번호같은거 @<-꼭 포함시켰나하는 검사)하는 콜 함수를 Form이 속성으로 가지고 있다.
To obtain the FormState, you may use Form.of with a context whose ancestor is the Form, or pass a GlobalKey to the Form constructor and call GlobalKey.currentState.
FormState를 변경하거나 수정하기를 원한다면, "Form.of"를 context(해당 Form의 최고 부모의 주소context)와함께 써야할 것이다. 아니면 "GlobalKey"를 "Form"에 넘겨주고 "GlobalKey.currentState"를 콜해야 한다.


기술번역은... 어렵다..(오번역있으면 댓글해주세요)

원래대로라면 TextFormField를 여러개 만들고 아이콘도 위치 잡고 넣어주고 하는 번거로움이 있는데 Form을 이용하면 이러한 번거로움을 덜 수 있음.

1-2 FormBuilder 란?

아.. 도대체 폼빌더는 왜쓰는겨

profile
이해가 안돼시거나 질문이 있으신 분들은 댓글로 남겨주세요. 성심성의껏 응하겠습니다!

0개의 댓글