flex_form library
Classes
- FormBloc
- A BLoC implementation for a form. It is used by a FormComponent to communicate form's changes to the form's client application.
- FormBlocState
- The state of the FormBloc which is used to maintain the state of the form's.
- FormComponent
- A widget component used to build a form with support for field and form validation and submission.
- FormComponentTheme
- An InheritedWidget used to pass a form's FormComponentThemeData down the tree.
- FormComponentThemeData
-
Theme data for the FormComponent which is used to style a form.
To provide a customized look and field for a form's inputs, create an
instance of this class and copy the
textInputThemeto provide custom styles for thetextInputTheme. - FormDataEntity
- An entity associated with a form's data which is defined as a Map of FormFieldId and its value.
- FormDataProvider
- A basic interface for a form that requires loading and submitting data.
- FormEvent
- All of the events used to communicate with the FormBloc to perform specific form actions.
- FormFieldConfig
- Configuration for any form field in a form. The FormBloc extension class must provide an instance of FormFieldConfig for each of the form's fields.
-
FormInputDataMapper<
T extends FormDataEntity> - An interface for mapping between a specific form's FormFieldId and the form's FormDataEntity's corresponding property.
-
FormValidationProvider<
T extends FormDataEntity> - An interface to provide custom validation logic for a form.
- FormVM
- InputViewModel
- A set of InputViewModel classes one for each supported input type.
- MultipleSelectInputViewModel
- SelectOptionViewModel
- SingleSelectInputViewModel
- TextInput
- A common text input used to allow users to enter text.
- TextInputTheme
- TextInputThemeData
- Theme definition used by a TextInput widget to style the input.
- TextInputViewModel
- ToggledValueInputViewModel
Enums
- FormAction
- Form actions used to tell which event is current.
- FormFieldId
-
Form Ids used to reference a form's fields created and managed by a
FormComponent. The FormFieldIds are also used by the
FormInputDataMapper to map between a form's InputMap and a
FormProviderEntity. - FormFieldValidation
- Form field validation type associated with a validation relationship.
Functions
-
compareFieldEquality(
String? field1, String? field2, {bool ignoreCase = true}) → bool - Normalizes and compares the values of two text fields.
-
getValidationMessage(
FormFieldValidation type, FormFieldConfig validationConfig) → String? - Utility function for getting a validation message for a form field based on a specific FormFieldValidation and the form's FormFieldConfig.
-
validateField(
dynamic fieldValue, FormFieldConfig? validationConfig) → FormFieldValidation - Validates a field with a FormFieldConfig and returns a FormFieldValidation
Typedefs
-
FormDataBuilder
= Widget Function({String? buttonText, bool? canSubmit, String? cancelButtonText, required BuildContext context, Map<
FormFieldId, FocusNode> ? focusNodeMap, required Map<FormFieldId, InputViewModel> inputMap, bool? isLoading, bool? isSubmitting, Map<FormFieldId, ValueChanged> ? onChangeCallbackMap, VoidCallback? onSubmit, Map<FormFieldId, TextEditingController> ? textControllerMap}) - Form builder using components of the inputs to layout the inputs based on a custom layout.
-
FormInputBuilder
= Widget Function({String? buttonText, bool? canSubmit, String? cancelButtonText, required BuildContext context, VoidCallback? onSubmit, required List<
Widget> textInputs}) - Form builder to build input widgets prepared by the component.