flutter_form_annotations library
Classes
- FieldCheckbox
- FieldChoiceChip
- FieldClass
- FieldDatePicker
- @FieldDatePicker() decorator. Use this with DateTime fields to input dates. All properties are optional. initialDate is set to current date if not provided. firstDate is set to current date if not provided. lastDate is set to firstDate if provided else current date if not provided.
- FieldDateRangePicker
-
@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"" - FieldDropdown
- FieldDropdownHideUnderline
- FieldRadio
- FieldRangeSlider
- FieldSlider
- FieldSwitch
- FieldText
- @FieldText() decorator is used to decorate each Text, Number, Email, password or Phone field in the form. All properties are optional.
- FieldTextArea
- @FieldTextArea() decorator is used to decorate each TextArea field in the form. All properties are optional.
- FormBuilder
- @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.
- FormValidator
Functions
-
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
Enums
- FieldPropertyType
- FieldValidator
-
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'} },
- FormFieldType