BlocxFormWidgetState<W extends BlocxFormWidget<P> , F extends BlocxBaseFormEntity<F, E> , P, E extends Enum> class
abstract
Base state class for screens that host a BlocxFormBloc.
Extends BlocxScreenManagerState so all screen-manager side effects,
such as snackbars, error pages, and pop events, are handled automatically.
Type parameters:
W: The BlocxFormWidget subclass this state belongs to.F: The immutable form entity type.P: The optional payload type for edit/update forms.E: The form field enum type.
- Inheritance
-
- Object
- State<
W> - BlocXWidgetState<
W> - BlocxFormWidgetState
Constructors
Properties
- autoCloseBloc → bool
-
Whether bloc is closed when this state is disposed.
no setter
- autovalidateMode → AutovalidateMode
-
The default AutovalidateMode for native form fields.
no setter
-
bloc
↔ BlocxFormBloc<
F, P, E> -
The form bloc that drives this screen.
latefinal
- colorScheme → ColorScheme
-
no setterinherited
- context → BuildContext
-
The location in the tree where this widget builds.
no setterinherited
- formVerticalSpacing → double
-
Vertical spacing between form fields.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
no setterinherited
- isUpdate → bool
-
Whether this screen is in update/edit mode.
no setter
- isValid → bool
-
Whether the current form state has no validation errors.
no setter
-
keys
→ List<
E> -
The list of field keys controlled by managed text controllers.
no setter
- managerCubit → ScreenManagerCubit
-
The
ScreenManagerCubitthat drives this screen's side-effects.no setter - mounted → bool
-
Whether this State object is currently in a tree.
no setterinherited
- payload → P?
-
The current widget payload.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state
→ BlocxFormState<
F, E> -
The current form state.
no setter
- textTheme → TextTheme
-
no setterinherited
- theme → ThemeData
-
no setterinherited
- widget → W
-
The current configuration.
no setterinherited
- width → double
-
no setterinherited
- wrapInScaffold → bool
-
Whether the body should be wrapped in a Scaffold.
no setterinherited
Methods
-
activate(
) → void -
Called when this object is reinserted into the tree after having been
removed via deactivate.
inherited
-
applyInitialDataToForm(
F formData) → void -
Hydrates managed text controllers from
formData. -
blocListener(
BuildContext context, BlocxFormState< F, E> state) → void - Reacts to listen-only form states.
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
inherited
-
changeListener(
dynamic data, E key) → void -
Dispatches a manual field update for
key. -
checkbox(
{required E key, required bool isChecked, BlocxCheckboxOptions? options}) → BlocxFormCheckbox< F, P, E> -
Builds a
BlocxFormCheckboxconnected tokey. -
clearFieldError(
E key, {String? message}) → void -
Clears errors for
key. -
deactivate(
) → void -
Called when this object is removed from the tree.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
decorateScaffold(
Widget scaffold) → Widget -
Hook to decorate the scaffold returned by
scaffoldWidget.inherited -
didChangeDependencies(
) → void -
Called when a dependency of this State object changes.
inherited
-
didUpdateWidget(
covariant W oldWidget) → void -
Called whenever the widget configuration changes.
inherited
-
displaySnackBar(
BuildContext context, String message, String? title, BlocXSnackbarType snackbarType) → void -
Shows a
BlocxSnackBarwith the given parameters.inherited -
dispose(
) → void -
Called when this object is removed from the tree permanently.
override
-
dropdown<
T> (E key, {BlocXDropdownOptions? options, required List< DropdownMenuItem< items}) → BlocXFormDropdown<T> >F, P, E, T> -
Builds a BlocXFormDropdown connected to
key. -
errorWidget(
BuildContext context, ScreenManagerCubitStateDisplayErrorPage state) → Widget -
Builds the full-page error widget for
ScreenManagerCubitStateDisplayErrorPage.inherited -
errorWidgetByErrorCode(
BuildContext context, ScreenManagerCubitStateDisplayErrorPageByErrorCode state) → Widget -
Builds the full-page error widget for
ScreenManagerCubitStateDisplayErrorPageByErrorCode.inherited -
formWidget(
BuildContext context, BlocxFormState< F, E> state) → Widget -
Builds the form UI from the current
state. -
generateBloc(
) → BlocxFormBloc< F, P, E> -
Instantiates the
BlocxFormBlocfor this screen. -
getFocusNode(
E key) → FocusNode -
Returns the managed FocusNode for
key. -
getTextEditingController(
E key) → TextEditingController -
Returns the managed TextEditingController for
key. -
initState(
) → void - Called when this object is inserted into the tree.
-
mainWidget(
BuildContext context, ScreenManagerCubitState state) → Widget - The primary screen content.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onFormSubmitted(
BlocxFormStateFormSubmitted< F, E> state) → void -
Called when
BlocxFormStateFormSubmittedis emitted. -
onFormUpdated(
F formData) → void -
Called when
BlocxFormStateFormUpdatedis emitted. -
reassemble(
) → void -
Called whenever the application is reassembled during debugging, for
example during hot reload.
inherited
-
scaffoldWidget(
BuildContext context, Widget body) → Widget -
Wraps
bodyin a Scaffold.inherited -
setErrorToField(
E key, String message) → void -
Adds a persistent error to
key. -
setState(
VoidCallback fn) → void -
Notify the framework that the internal state of this object has changed.
inherited
-
setTimedErrorToField(
E key, String message, {Duration? duration}) → void -
Adds a timed error to
key. -
submit(
) → void -
Dispatches
BlocxFormEventSubmit. -
textField(
E key, {BlocXTextFieldOptions? options, FormFieldValidator< String> ? validator, TextFieldType? type}) → BlocXFormTextField<F, P, E> -
Builds a BlocXFormTextField connected to
key. -
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringShort(
) → String -
A brief description of this object, usually just the runtimeType and the
hashCode.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited