NyFormData class
NyFormData is a class that helps in managing form data
- Implementers
Constructors
- NyFormData(String name)
Properties
- getAutoFocusedField → String?
-
Get the autofocus field for the form
no setter
-
getCast
→ Map<
String, FormCast?> -
Get the cast data for the form
no setter
-
getDummyData
→ Map<
String, String?> -
Get the dummy data for the form
no setter
-
Get the footer data for the form
no setter
-
getHeaderData
→ Map<
String, Widget?> -
Get the header data for the form
no setter
-
getHiddenData
→ Map<
String, dynamic> -
Get the hidden data for the form
no setter
-
getLabels
→ Map<
String, String?> -
Get the labels for the form
no setter
- getLoadData → dynamic Function()?
-
Get the load data function for the form
no setter
-
getMetaData
→ Map<
String, dynamic> -
Get the footer data for the form
no setter
-
getReadOnlyData
→ Map<
String, dynamic> -
Get the readonly data for the form
no setter
-
getStyle
→ Map<
String, dynamic> -
Get the style data for the form
no setter
-
getValidate
→ Map<
String, FormValidator?> -
Get the validate data for the form
no setter
-
groupedItems
→ List<
List> -
Get the grouped items for the form
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- init → dynamic Function()?
-
Initialize the form
no setter
-
isReady
→ Stream<
bool> -
Stream for the form
no setter
- name ↔ String?
-
The name of the form
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stateName → String
-
Returns the state name for the form
no setter
- submitButton → Widget?
-
Submit button widget
no setter
- updated → StreamController?
-
StreamController for the form
no setter
Methods
-
clear(
{bool refreshState = true}) → void - Clear the form
-
clearField(
String key) → void - Clear a field in the form
-
create(
{Map< String, dynamic> ? initialData, double? crossAxisSpacing, double? mainAxisSpacing, dynamic onChanged(String field, Map<String, dynamic> data)?, bool? validateOnFocusChange, bool? locked}) → NyForm -
Create a new form
initialDataThe initial data for the formcrossAxisSpacingThe cross axis spacing for the formmainAxisSpacingThe main axis spacing for the formonChangedThe onChanged function for the formvalidateOnFocusChangeValidate on focus changelockedLock the form -
data(
{String? key, bool lowerCaseKeys = false}) → dynamic -
Returns the data for the form
If a
keyis provided, it will return the data for that key -
fieldData(
Field field) → Map< String, dynamic> - Get the data for a field
-
fields(
) → dynamic - Returns the fields for the form
-
formReady(
) → void - Check if the form is ready
-
hasField(
String fieldKey) → bool - Check if a field exists in the form
-
initialData(
dynamic loadData(), {bool refreshState = false}) → void - Load data for the form
-
initializeStream(
) → StreamController? - Initialize the stream for the form
-
isValid(
) → bool - Check if the form passes validation
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onChange(
String field, Map< String, dynamic> data) → void - On change function for the form
-
refreshForm(
) → void - Refresh the form
-
setData(
Map< String, dynamic> data, {bool refreshState = true}) → void - Set the data for the form
-
setFieldOptions(
String key, dynamic value, {bool refreshState = true}) → void - Set the options for a field in the form If the field does not exist, it will throw an exception
-
setFieldValue(
String key, dynamic value, {bool refreshState = true}) → void - Set the value for a field in the form If the field does not exist, it will throw an exception
-
submit(
{required dynamic onSuccess(dynamic value), dynamic onFailure(Exception exception)?, bool showToastError = true}) → void -
Submit the form
If the form is valid, it will call the
onSuccessfunction -
toString(
) → String -
A string representation of this object.
inherited
-
validate(
) → Map< String, dynamic> - Validate the form
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited