Erstellen Sie Flutter-Formulare mit JSON, mit einer Vielzahl integrierter Formularsteuerelemente, Unterstützung für Validierung, benutzerdefinierte Layouts, benutzerdefinierte Stile und unbegrenzte verschachtelte Formulargruppierung.
Aus öffentlichen Paketdaten erstellte Orientierung.
json_gen_form ist ein Flutter-Paket, das die dynamische Formularerstellung aus JSON ermöglicht und eine Vielzahl integrierter Formularsteuerelemente, Validierungsregeln, benutzerdefinierte Layouts und Styling unterstützt. Es erlaubt geschachtelte Formulargruppierung und ist daher ideal für servergetriebene Benutzeroberflächen. Entwickler können Formulare deklarativ in JSON definieren, wodurch Boilerplate reduziert und flexible, wartbare Formularstrukturen über Plattformen hinweg ermöglicht werden.
Anwendungsfälle
Dynamische Formularrenderung aus JSON
Servergetriebene Benutzeroberfläche mit konfigurierbaren Formularen
Verschachtelte Formularstrukturen
Echtzeit-Formularvalidierung
Anpassbare Formularlayouts
Hauptmerkmale
Eingebaute Formularsteuerelemente
Validierungsunterstützung
Benutzerdefinierte Layouts und Stile
Verschachtelte Formulargruppierung
JSON-basierte Formulardefinition
Geeignet für
Entwickler, die servergesteuerte Benutzeroberflächen erstellen
Teams, die wiederverwendbare Formularelogik benötigen
Apps, die dynamischen Formularinhalt erfordern
Frontend-Entwickler, die mit JSON-Schemas arbeiten
Projekte mit häufigen Formularänderungen
Hinweise
Erfordert sorgfältige JSON-Schema-Design
Beschränkt auf unterstützte Steuertypen
Möglicherweise sind zusätzliche Überprüfungslogik erforderlich
Laufzeit-Parsing-Aufwand
Abhängig von genauen JSON-Eingaben
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
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>