FancyManager class abstract
An abstract class that manages the state and validation of a form. It provides methods to handle form inputs, validation, and retrieving controllers by their ID.
Constructors
-
FancyManager({GlobalKey<
FormState> ? formKey}) -
Creates a FancyManager instance with an optional
formKey
. If noformKey
is provided, a new GlobalKey<FormState> will be created.
Properties
-
formKey
↔ GlobalKey<
FormState> -
A global key for the form state, used to manage form validation and submission.
getter/setter pair
- hasBeenSubmitted ↔ bool
-
A flag indicating whether the form has been submitted.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
inputs
↔ List<
FancyInput> -
A list of FancyInput instances, representing the inputs in the form.
This list must be implemented by subclasses.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
controllerFromId(
String id) → TextEditingController -
Retrieves the TextEditingController for the input field with the given
id
. Throws an exception if no input with the givenid
is found. -
dispose(
) → void - Disposes of all input controllers, releasing their resources.
-
getInput(
String id) → FancyInput -
Retrieves the FancyInput instance associated with the input field with the given
id
. Throws an exception if no input with the givenid
is found. -
getText(
String id) → String -
Retrieves the text entered in the input field with the given
id
. Throws an exception if no input with the givenid
is found. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setFormKey(
GlobalKey< FormState> formKey) → void -
Sets a new
formKey
to the form manager. -
toString(
) → String -
A string representation of this object.
inherited
-
validate(
) → bool - Validates the form by checking all input fields. Sets hasBeenSubmitted to true and returns true if the form is valid, otherwise false.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited