controllers/lite_form_controller
library
Functions
-
clearLiteForm(String formName)
→ void
-
call this function if you want to clear the values for
a form. Usually forms are cleared automatically when
their containing widget is disposed but this
behavior changes if you pass
autoDispose
: false
to LiteFormGroup
-
form(String path)
→ _FormShorthand
-
example of usage form('signup.firstName').field.get();
-
getFieldValue<T>({required String formName, required String fieldName, bool applySerializer = false})
→ T?
-
Returns current value for any form field.
If the form is not disposed and the value was set
you can get it here
-
getFormData({required String formName, bool applySerializers = true})
→ Future<Map<String, dynamic>>
-
Returns current data for a form
formName
the name of the form you want to get the data for
-
getValue<T>(String path)
→ T?
-
It's just a shorthand for getFieldValue
path is a dot separated path where the first part is
form name and the second is field name
e.g. signup.lastName
-
isFormBeingValidated(String formName)
→ bool
-
Allows to check if a form is in the process of being validated
-
validateLiteForm(String formName)
→ Future<bool>
-
This method is made asynchronous because
validators in LiteForms can be asynchronous unlike
many in other form packages