FormBlocListener<FormBloc2 extends FormBloc<SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> class
BlocListener that reacts to the state changes of the FormBloc.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SingleChildStatefulWidget
- BlocListenerBase<
FormBloc2, FormBlocState< SuccessResponse, ErrorResponse> > - BlocListener<
FormBloc2, FormBlocState< SuccessResponse, ErrorResponse> > - FormBlocListener
- Implemented types
Constructors
-
FormBlocListener.new({Key? key, FormBloc2? formBloc, Widget? child, FormBlocListenerCallback<
FormBlocLoading< ? onLoading, FormBlocListenerCallback<SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse>FormBlocLoaded< ? onLoaded, FormBlocListenerCallback<SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse>FormBlocLoadFailed< ? onLoadFailed, FormBlocListenerCallback<SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse>FormBlocSubmitting< ? onSubmitting, FormBlocListenerCallback<SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse>FormBlocSuccess< ? onSuccess, FormBlocListenerCallback<SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse>FormBlocFailure< ? onFailure, FormBlocListenerCallback<SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse>FormBlocSubmissionCancelled< ? onSubmissionCancelled, FormBlocListenerCallback<SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse>FormBlocSubmissionFailed< ? onSubmissionFailed, FormBlocListenerCallback<SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse>FormBlocDeleting< ? onDeleting, FormBlocListenerCallback<SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse>FormBlocDeleteFailed< ? onDeleteFailed, FormBlocListenerCallback<SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse>FormBlocDeleteSuccessful< ? onDeleteSuccessful})SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> - BlocListener that reacts to the state changes of the FormBloc.
Properties
- bloc → FormBloc2?
-
The bloc whose
state
will be listened to. Whenever the bloc'sstate
changes, listener will be invoked.finalinherited - child → Widget?
-
The Widget which will be rendered as a descendant of the BlocListener.
no setteroverride
- formBloc → FormBloc2?
-
If the formBloc parameter is omitted, FormBlocListener
will automatically perform a lookup using
BlocProvider.of<FormBloc> and the current BuildContext.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
listener
→ BlocWidgetListener<
FormBlocState< SuccessResponse, ErrorResponse> > -
The BlocWidgetListener which will be called on every
state
change. This listener should be used for any code which needs to execute in response to astate
change.finalinherited -
listenWhen
→ BlocListenerCondition<
FormBlocState< ?SuccessResponse, ErrorResponse> > -
An optional listenWhen can be implemented for more granular control
over when listener is called.
listenWhen will be invoked on each bloc
state
change. listenWhen takes the previousstate
and currentstate
and must return a bool which determines whether or not the listener function will be invoked. The previousstate
will be initialized to thestate
of the bloc when the BlocListener is initialized. listenWhen is optional and if omitted, it will default totrue
.finalinherited -
onDeleteFailed
→ FormBlocListenerCallback<
FormBlocDeleteFailed< ?SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> -
It is the state when the
FormBlocState._isValidByStep
isfalse
and FormBloc.submit is called.final -
onDeleteSuccessful
→ FormBlocListenerCallback<
FormBlocDeleteSuccessful< ?SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> -
It is the state when the
FormBlocState._isValidByStep
isfalse
and FormBloc.submit is called.final -
onDeleting
→ FormBlocListenerCallback<
FormBlocDeleting< ?SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> -
It is the state when the
FormBlocState._isValidByStep
isfalse
and FormBloc.submit is called.final -
onFailure
→ FormBlocListenerCallback<
FormBlocFailure< ?SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> -
It is the state when the form are submitting and fail.
The previous state must be FormBlocSubmitting.
final
-
onLoaded
→ FormBlocListenerCallback<
FormBlocLoaded< ?SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> -
It is the state when you can
submit
the FormBloc.final -
onLoadFailed
→ FormBlocListenerCallback<
FormBlocLoadFailed< ?SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> -
It is the state when you failed to pre/fill the
fieldBlocs
. The previous state must be FormBlocLoading.final -
onLoading
→ FormBlocListenerCallback<
FormBlocLoading< ?SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> -
It is the state when you need to pre/fill the
fieldBlocs
usually with asynchronous data. The previous state must be FormBlocLoading.final -
onSubmissionCancelled
→ FormBlocListenerCallback<
FormBlocSubmissionCancelled< ?SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> -
It is the state that you must yield last in the method
FormBloc.onCancelingSubmission.
The previous state must be FormBlocSubmitting.
final
-
onSubmissionFailed
→ FormBlocListenerCallback<
FormBlocSubmissionFailed< ?SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> -
It is the state when the
FormBlocState._isValidByStep
isfalse
and FormBloc.submit is called.final -
onSubmitting
→ FormBlocListenerCallback<
FormBlocSubmitting< ?SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> -
It is the state when the FormBloc is submitting.
It is called automatically when FormBloc.submit
is called successfully, and usually is used to
update the submission progress.
final
-
onSuccess
→ FormBlocListenerCallback<
FormBlocSuccess< ?SuccessResponse, ErrorResponse> , SuccessResponse, ErrorResponse> -
It is the state when the form is submitted successfully.
The previous state must be FormBlocSubmitting.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → SingleChildStatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → SingleChildState< BlocListenerBase< FormBloc2, FormBlocState< >SuccessResponse, ErrorResponse> > -
Creates the mutable state for this widget at a given 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
-
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