FormBlocListener<FormBloc extends FormBloc<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse> class

BlocListener that reacts to the state changes of the FormBloc.

Inheritance

Constructors

FormBlocListener({Key? key, FormBloc? formBloc, Widget? child, FormBlocListenerCallback<FormBlocLoading<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>? onLoading, FormBlocListenerCallback<FormBlocLoaded<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>? onLoaded, FormBlocListenerCallback<FormBlocLoadFailed<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>? onLoadFailed, FormBlocListenerCallback<FormBlocSubmitting<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>? onSubmitting, FormBlocListenerCallback<FormBlocSuccess<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>? onSuccess, FormBlocListenerCallback<FormBlocFailure<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>? onFailure, FormBlocListenerCallback<FormBlocSubmissionCancelled<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>? onSubmissionCancelled, FormBlocListenerCallback<FormBlocSubmissionFailed<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>? onSubmissionFailed, FormBlocListenerCallback<FormBlocDeleting<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>? onDeleting, FormBlocListenerCallback<FormBlocDeleteFailed<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>? onDeleteFailed, FormBlocListenerCallback<FormBlocDeleteSuccessful<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>? onDeleteSuccessful})
BlocListener that reacts to the state changes of the FormBloc.

Properties

bloc → FormBloc?
The bloc whose state will be listened to. Whenever the bloc's state changes, listener will be invoked.
finalinherited
child Widget?
The Widget which will be rendered as a descendant of the BlocListener.
no setteroverride
formBloc → FormBloc?
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 a state 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 previous state and current state and must return a bool which determines whether or not the listener function will be invoked. The previous state will be initialized to the state of the bloc when the BlocListener is initialized. listenWhen is optional and if omitted, it will default to true.
finalinherited
onDeleteFailed FormBlocListenerCallback<FormBlocDeleteFailed<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>?
It is the state when the FormBlocState._isValidByStep is false and FormBloc.submit is called.
final
onDeleteSuccessful FormBlocListenerCallback<FormBlocDeleteSuccessful<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>?
It is the state when the FormBlocState._isValidByStep is false and FormBloc.submit is called.
final
onDeleting FormBlocListenerCallback<FormBlocDeleting<SuccessResponse, ErrorResponse>, SuccessResponse, ErrorResponse>?
It is the state when the FormBlocState._isValidByStep is false 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 is false 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<FormBloc, 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}) 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