NyFormData class
NyFormData is a class that helps in managing form data
- Implementers
Constructors
- NyFormData.new(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
-
getStyle
→ Map<
String, String?> -
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
- 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
- updated → StreamController?
-
StreamController for the form
final
Methods
-
cast(
) → Map< String, dynamic> - Returns the cast for the form
-
clear(
) → dynamic - Clear the form
-
clearField(
String key) → dynamic - Clear a field in the form
-
create(
{Map< String, dynamic> ? initialData, double? crossAxisSpacing, double? mainAxisSpacing, dynamic onChanged(Map<String, dynamic> data)?, bool? validateOnFocusChange, bool? locked}) → NyForm -
Create a new form
initialData
The initial data for the formcrossAxisSpacing
The cross axis spacing for the formmainAxisSpacing
The main axis spacing for the formonChanged
The onChanged function for the formvalidateOnFocusChange
Validate on focus changelocked
Lock the form -
data(
{String? key}) → dynamic -
Returns the data for the form
If a
key
is provided, it will return the data for that key -
dummyData(
) → Map< String, dynamic> - Returns the dummy data for the form
-
fieldData(
Field field) → Map< String, dynamic> - Get the data for a field
-
fields(
) → dynamic - Returns the fields for the form
-
hasField(
String fieldKey) → bool - Check if a field exists in the form
-
isValid(
) → bool - Check if the form passes validation
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setData(
Map< String, dynamic> data, {bool refreshState = true}) → dynamic - Set the data for the form
-
setField(
String key, dynamic value, {bool refreshState = true}) → dynamic - Set the value for a field in the form If the field does not exist, it will throw an exception
-
style(
) → Map< String, dynamic> - Returns the style for the form
-
submit(
{required dynamic onSuccess(dynamic value), dynamic onFailure(Exception exception)?, bool showToastError = true}) → dynamic -
Submit the form
If the form is valid, it will call the
onSuccess
function -
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