FormRegisterButton<F extends BaseFormEntity<F, E> , P, E extends Enum> class
A reusable submit/register button that reacts to a form state.
-
While the form is submitting (
BlocxFormStateSubmittingForm) the button:- disables
onPressed - swaps
buttonTextwithsubmitText - shows a small progress indicator (customizable)
- disables
-
Choose the visual style via type.
-
Customize per-type styles using the provided
*Styleparameters. -
Override
buildOtherButtonin a subclass to provide a custom button. The baseotherimplementation returns a SizedBox.shrink by design.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- BlocxStatelessWidget
- FormRegisterButton
Constructors
-
FormRegisterButton({Key? key, required BlocxFormState<
dynamic, Enum> state, required String buttonText, required String submitText, required VoidCallback? onPressed, RegisterButtonType type = RegisterButtonType.filled, ButtonStyle? elevatedStyle, ButtonStyle? filledStyle, ButtonStyle? textStyle, ButtonStyle? outlinedStyle, TextStyle? labelTextStyle, WidgetBuilder? loadingIndicatorBuilder, double spacing = 8.0, ButtonStyle? style}) -
const
Properties
-
Label when idle.
final
- elevatedStyle → ButtonStyle?
-
Optional style for RegisterButtonType.elevated.
final
- filledStyle → ButtonStyle?
-
Optional style for RegisterButtonType.filled.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCheckingFields → bool
-
no setter
- isSubmittingForm → bool
-
True while the form is in submitting state.
no setter
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- labelTextStyle → TextStyle?
-
Optional text style applied to the inner Text.
final
- loadingIndicatorBuilder → WidgetBuilder?
-
Builder for the loading indicator (material & cupertino).
If null, a platform-appropriate default spinner is used.
final
- onPressed → VoidCallback?
-
final
- outlinedStyle → ButtonStyle?
-
Optional style for RegisterButtonType.outlined.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spacing → double
-
Spacing between spinner and text.
final
-
state
→ BlocxFormState<
dynamic, Enum> -
Current form state (used to detect submitting).
final
- style → ButtonStyle?
-
final
- submitText → String
-
Label shown while submitting.
final
- textStyle → ButtonStyle?
-
Optional style for RegisterButtonType.text.
final
- type → RegisterButtonType
-
Which visual variant to render.
final
Methods
-
bloc(
BuildContext context) → BlocxFormBloc< F, P, E> -
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
buildElevatedButton(
BuildContext context, {required String label, required bool disabled}) → Widget - Builds an ElevatedButton variant.
-
buildFilledButton(
BuildContext context, {required String label, required bool disabled}) → Widget - Builds a FilledButton (Material 3) variant.
-
buildOtherButton(
BuildContext context, {required String label, required bool disabled}) → Widget - Default implementation for custom/other style.
-
buildOutlinedButton(
BuildContext context, {required String label, required bool disabled}) → Widget - Builds an OutlinedButton variant.
-
buildTextButton(
BuildContext context, {required String label, required bool disabled}) → Widget - Builds a TextButton variant.
-
colorScheme(
BuildContext context) → ColorScheme -
inherited
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
textTheme(
BuildContext context) → TextTheme -
inherited
-
theme(
BuildContext context) → ThemeData -
inherited
-
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
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited