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

Constructors

BlocxFormWidgetState()

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
defaultTextFieldType → TextFieldType
no setter
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 ScreenManagerCubit that drives this screen's side-effects.
no setteroverride
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 BlocxFormCheckbox connected to key.
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 BlocxSnackBar with the given parameters.
inherited
dispose() → void
Called when this object is removed from the tree permanently.
override
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
formButtonRow(String registerText, {String? registerSubmittingText, String? secondButtonText, BlocxFormButtonRowOptions? options, VoidCallback? onRegisterPressed, VoidCallback? onSecondButtonPressed, RegisterButtonType? registerType}) → BlocxFormButtonRow<F, P, E>
Builds a BlocxFormButtonRow connected to the current form state.
formWidget(BuildContext context, BlocxFormState<F, E> state) → Widget
Builds the form UI from the current state.
generateBloc() → BlocxFormBloc<F, P, E>
Instantiates the BlocxFormBloc for 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.
override
mainWidget(BuildContext context, ScreenManagerCubitState state) → Widget
The primary screen content.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onFormSubmitted(BlocxFormStateFormSubmitted<F, E> state) → void
Called when BlocxFormStateFormSubmitted is emitted.
onFormUpdated(F formData, E updatedKey, dynamic oldValue, dynamic newValue) → void
Called when BlocxFormStateFormUpdated is emitted.
reassemble() → void
Called whenever the application is reassembled during debugging, for example during hot reload.
inherited
requestFocusOnError(BlocxFormState<F, E> state) → void
Focuses the first form field that currently has an error.
scaffoldWidget(BuildContext context, Widget body) → Widget
Wraps body in 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.
submitButton(String buttonText, {String? submitText, BlocxFormRegisterButtonOptions? options, VoidCallback? onPressed, RegisterButtonType? type}) → BlocxFormRegisterButton<F, P, E>
Builds a BlocxFormRegisterButton connected to the current form state.
textField(E key, {BlocXTextFieldOptions? options, FormFieldValidator<String>? validator, TextFieldType? type, String? labelText, String? hintText, String? helperText, Widget? prefix, Widget? suffix, TextInputType? keyboardType, TextInputAction? textInputAction, bool? obscureText, bool? enabled, bool? autofocus, bool? showClearButton, int? maxLines, int? errorMaxLines, int? minLines, int? maxLength}) → 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