form_gen library


A Material Design checkbox.
A Material Design choice chip. ChoiceChips represent a single choice from a set. Choice chips contain related descriptive text or categories. The selected and label arguments must not be null.
Nested field is a field that contains other fields. The Fields are defined in the properties property.
Displays a grid of days for a given month and allows the user to select a date.
@FieldDateRangePicker() allows picking a range of dates All properties are optional. All dates are 'yyyy-MM-dd' initialDate is set to current date if not provided. firstDate is set to 25 years before current date if not provided. lastDate is set to 25 years after current date if not provided. initialDateRange ia string in "yyyy-MM-dd, yyyy-MM-dd" format specifies the initial date range. if not provided it is set to "firstDate, lastDate""
A dropdown button lets the user select from a number of items. The button shows the currently selected item as well as an arrow that opens a menu for selecting another item.
Shows a dropdown field hiding the underline.
Filter chips use tags or descriptive words as a way to filter content. Filter chips are a good alternative to Checkbox or Switch widgets. Unlike these alternatives, filter chips allow for clearly delineated and exposed options in a compact area.
A Material Design radio button.
Used to select a range of values within a set of values.
Used to select a single value from a range of values.
Switch is a two state button that can be either on or off.
@FieldText() decorator is used to decorate each Text, Number, Email, password or Phone field in the form. All properties are optional.
@FieldTextArea() decorator is used to decorate each TextArea field in the form. All properties are optional.
@FormBuilder is the decorator used to generate a form from a class. allowNullorEmpty if set to true allows the form to save with empty or null values. needScaffold if set to true will generate a scaffold with a form, otherwise the form will be generated as a widget.


camelCaseToTitleCase(String label) String
getKeyboardType(String type) String
Returns TextInputType for the given FormFieldType.
hasSubAttributes(Map<String, dynamic> defs, FormFieldType fieldType, String key) bool
isMeta(String key) bool
isValidAttribute(String attribute) bool
isValidFieldType(String fieldType) bool
isValidType(String type) bool
max(double a, double b) double
min(double a, double b) double
mustHaveValues(String fieldType) bool
stringToTypeValue(String type, String value) → dynamic
typeToValue(String fieldType) String
valueToType(String? fieldType) String


This enum should be used to specify the validation type. The Field decorator has a property validator which expects a List<Map<FieldValidator, dynamic>>. validator: { FieldValidator.required: {'message': 'Fill this or else} }, { FieldValidator.minLength: {'length': 5, 'message': 'Too short'} },