If(_.value = "Other" & (val = null || val.isEmpty)) map((lang) => FormBuilderFieldOption(value: lang))ĭecoration: InputDecoration(labelText: "If Other, please specify"), with default errorText in English but withĪbility to include you own error message that will display whenever validation fails.ĭecoration: InputDecoration(labelText: 'My best language'), Max, minLength, maxLength, IP, credit card etc. The package comes with several most common FormFieldValidators such as required, numeric, mail, URL, min, Of validation functions as well as allow reusability of already defined validator methods. The validators attribute in fields take in any number of FormFieldValidator allowing composability The FormField will not require a validator if the validators property is already defined in the FormBuilderCustomField.ĬontentPadding : EdgeInsets. To build your own field within a FormBuilder, we use FormBuilderCustomField which will require that you define your own FormField. The rest of the attributes will be determined by the type of Widget being used. transform TextField value for numeric field from String to num This event function will fire immediately the the field value changesįunction that transforms field value before saving to form value. List of FormFieldValidators that will check the validity of value candidate in the FormField This value will be ignored if the readonly attribute of FormBuilder widget is set to true This will form the key in the form value Mapĭetermines whether the field widget will accept user input. In order to create an input field in the form, along with the label, and any applicable validation, there are several attributes that are supported by all types of inputs namely: Attribute FormBuilderTypeAhead - Auto-completes user input from a list of items.Allows input of single-line text, multi-line text, password,Įmail, urls etc by using different configurations and validators FormBuilderTextField - For text input.FormBuilderStepper - Selection of a number by tapping on a plus or minus symbol.FormBuilderSlider - For selection of a numerical value on a slider.FormBuilderSignaturePad - Presents a drawing pad on which user can doodle.FormBuilderSegmentedControl - For selection of a value from the CupertinoSegmentedControl as an input.FormBuilderRate - For selection of a numerical value as a rating.FormBuilderRadio - Allow selection of one value from a list of Radio Widgets.FormBuilderDropdown - Allow selection of one value from a list as a Dropdown.FormBuilderDateTimePicker - For Date, Time and DateTime input.FormBuilderChipsInput - Takes a list of Chips as input.FormBuilderCheckboxList - List of Checkboxes for multiple selection.FormBuilderCheckbox - Single Checkbox field.Label : Text( 'I Accept the tems and conditions'),ĭecoration : InputDecoration(labelText : "Stepper"),ĭecoration : InputDecoration(labelText : "Rate this form"),ĭecoration : InputDecoration(labelText : "The language of my people"),įormBuilderFieldOption(value : "Kotlin"),įormBuilderFieldOption(value : "Objective-C"),ĭecoration : InputDecoration(labelText : "Signature"), (number) => FormBuilderFieldOption(value : number)) map((lang) => FormBuilderFieldOption(value : lang))ĭecoration : InputDecoration(labelText : "Movie Rating (Archer)"), "I have read and agree to the terms and conditions"),ĮrrorMessage : "You must accept terms and conditions to continue",ĭecoration : InputDecoration(labelText : "Gender"),ĭecoration : InputDecoration(labelText : "Age"),ĭecoration : InputDecoration(labelText : 'My chosen language'), Validators : ,ĭecoration : InputDecoration(labelText : "Number of somethings"), Decoration : InputDecoration(labelText : "Appointment Time"),
0 Comments
Leave a Reply. |