dynamicform

pub GitHub

create your form with easier way

Getting Started

  • generate form
  • Pre-existing elements

Installing

Add the following to your pubspec.yaml file:

dependencies:
	dynamic_form: ^0.3.0

Simple Usage

Creating a basic SimpleDynamicForm

SimpleDynamicForm(
      key: dynamicFormKey,
      groupElements: [
              GroupElement(
                            directionGroup: DirectionGroup.Vertical,
                            textElements: [
                            TextElement(label: "name"),
                            TextElement(
                                 label: "password", typeInput: TypeInput.Password)
                              ],
                             )
                  ],
              );

Declare GlobalKey to get validation,list values of forms

GlobalKey<SimpleDynamicFormState> dynamicFormKey = GlobalKey<SimpleDynamicFormState>();

validate forms

dynamicFormKey.currentState.validate()

all values in form

dynamicFormKey.currentState.recuperateAllValues()

How to skectch your form ?

textElement is small element in dynamicForm GroupElement is group of TextElement

GroupElement

PropertiesDescription
directionGroupDirection of form (Vertical/Horizontal)
sizeElementssize of each textElement of form When direction Horizontal,sum of values should be egal a 1
textElementsgroup of textElement.
paddingpadding of groups.
decorationdecoration of container groups.
backgroundColorcolor of the container groups.

textElement

PropertiesDescription
typeInputEnumerate to specifie type of TextField.
labeltext label of TextField.
hinttext hint of textField.
errorMsgmessage to show when TextField isn't validate.
labelStylestyle of label TextField
errorStylestyle of error message TextField
hintStylestyle of hint TextFieldcolor
readOnlyenable TextField uneditable
validatorcallback validation of TextField
paddingpadding of TextField

EmailElement

Pre-exsiting element with check validation of email Pre-initialized values

PasswordElement

Pre-exsiting element with check validation of passwed Pre-initialized values show/hide password

Libraries

dynamic_form