json_gen_form은 JSON에서 동적으로 폼을 생성할 수 있는 Flutter 패키지로, 다양한 내장 폼 컨트롤, 검증 규칙, 사용자 정의 레이아웃 및 스타일링을 지원합니다. 중첩된 폼 그룹화를 가능하게 하여 서버 기반 UI에 적합합니다. 개발자는 JSON에서 폼을 선언적으로 정의함으로써 반복 코드를 줄이고 플랫폼 간 유연하고 유지보수 가능한 폼 구조를 만들 수 있습니다.
사용 사례
JSON에서 동적 폼 렌더링
구성 가능한 양식을 갖춘 서버 기반 UI
중첩된 양식 구조
실시간 폼 검증
사용자 정의 가능한 양식 레이아웃
주요 기능
내장 폼 컨트롤
검증 지원
사용자 정의 레이아웃 및 스타일
중첩 폼 그룹화
JSON 기반 폼 정의
적합한 대상
서버 기반 UI를 구축하는 개발자
재사용 가능한 양식 로직이 필요한 팀
동적 폼 콘텐츠가 필요한 앱
JSON 스키마를 사용하는 프론트엔드 개발자
자주 양식이 변경되는 프로젝트
고려 사항
신중한 JSON 스키마 설계가 필요합니다
지원되는 컨트롤 유형에 제한됨
추가 검증 로직이 필요할 수 있습니다
런타임 분석 오버헤드
정확한 JSON 입력에 따라 달라집니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
JSON_GEN_FORM
Generate Flutter forms using JSON, featuring a variety of built-in form controls, support for validation, custom layouts, custom styles, and unlimited nested form grouping.
Except for group, row, and col, all types have the following general parameters. All types have extra.
Field
Description
Type
Default Value
Required
type
Type
String
''
true
field
Field Name
String
''
true
label
Label
String
-
-
hiddenLabel
Hidden Label
bool
false
-
value
Default Value
dynamic
-
-
disabled
Disabled
bool
false
-
readonly
Read-Only
bool
false
-
rules
Validation Rules
List
[]
-
extra
Extra Params
dynamic
-
Form Types
group
Field
Description
Type
Default Value
Required
type
Type
String
'group'
true
field
Field Name
String
''
-
label
Label
String
''
-
hiddenLabel
Hidden Label
bool
''
-
children
Sub-Forms
List
[]
-
text
Field
Description
Type
Default Value
Required
type
Type
String
'text'
true
placeholder
Placeholder
String
-
-
General Params
-
-
-
-
password
Field
Description
Type
Default Value
Required
type
Type
String
'password'
true
placeholder
Placeholder
String
-
-
General Params
-
-
-
-
textarea
Field
Description
Type
Default Value
Required
type
Type
String
'textarea'
true
placeholder
Placeholder
String
-
-
General Params
-
-
-
-
number
Field
Description
Type
Default Value
Required
type
Type
String
'number'
true
placeholder
Placeholder
String
-
-
General Params
-
-
-
-
radio
Field
Description
Type
Default Value
Required
type
Type
String
'radio'
true
options
Options
List
[]
-
direction
Options Direction
String
'horizontal'
-
itemHorizontalSpace
Item Horizontal Space
double
16
-
itemVerticalSpace
Item Vertical Space
double
8
-
General Params
-
-
-
-
checkbox
Field
Description
Type
Default Value
Required
type
Type
String
'checkbox'
true
options
Options
List
[]
-
direction
Options Direction
String
'horizontal'
-
itemHorizontalSpace
Item Horizontal Space
double
16
-
itemVerticalSpace
Item Vertical Space
double
8
-
General Params
-
-
-
-
select
Field
Description
Type
Default Value
Required
type
Type
String
'select'
true
options
Options
List
[]
-
multiple
Multiple Select
bool
false
-
General Params
-
-
-
-
switch
Field
Description
Type
Default Value
Required
type
Type
String
'switch'
true
General Params
-
-
-
-
media
Field
Description
Type
Default Value
Required
type
Type
String
'media'
true
mediaType
Media Type (media, image, video)
String
'media'
-
multiple
Multiple Uploads
bool
false
-
General Params
-
-
-
-
ios Configuration info.plist
<key>NSCameraUsageDescription</key>
<string>Need camera for taking photos or scanning codes</string><key>NSPhotoLibraryUsageDescription</key><string>Need access to photo library for selecting photos or videos</string><key>NSMicrophoneUsageDescription</key><string>Need microphone access for recording videos</string>