FormBloc<SuccessResponse, FailureResponse> class

Constructors

FormBloc({bool isEditing = false, bool customSubmit = true})

Properties

customSubmit bool
final
fields Map<String, FieldBloc<FieldBlocStateBase>>
no setter
hashCode int
The hash code for this object.
no setterinherited
isClosed bool
Whether the bloc is closed.
no setterinherited
isCreating bool
no setter
isEditing bool
no setter
isNotValid bool
no setter
isValid bool
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state FormBlocState<SuccessResponse, FailureResponse>
The current state.
no setterinherited
statusStream Stream<FormStatus>
getter/setter pair
stream Stream<FormBlocState<SuccessResponse, FailureResponse>>
The current stream of states.
no setterinherited
subscriptions List<StreamSubscription>
getter/setter pair

Methods

addError(Object error, [StackTrace? stackTrace]) → void
Reports an error which triggers onError with an optional StackTrace.
inherited
addField(FieldBloc<FieldBlocStateBase> field) → void
addFields(Iterable<FieldBloc<FieldBlocStateBase>> fields) → void
addSubscription(StreamSubscription subscription) → void
addSubscriptions(Iterable<StreamSubscription> subscriptions) → void
cancel() FutureOr<void>
cancelAllSubscriptions() → void
clear() FutureOr<void>
close() Future<void>
Closes the instance. This method should be called when the instance is no longer needed. Once close is called, the instance can no longer be used.
emit(FormBlocState<SuccessResponse, FailureResponse> state) → void
Updates the state to the provided state. emit does nothing if the state being emitted is equal to the current state.
inherited
emitCancelled() → void
emitFailure([FailureResponse? error]) → void
emitInitial() → void
emitLoading() → void
emitSuccess(SuccessResponse response) → void
initialize({Map<String, dynamic>? params}) FutureOr<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCancel() FutureOr<void>
onChange(Change<FormBlocState<SuccessResponse, FailureResponse>> change) → void
Called whenever a change occurs with the given change. A change occurs when a new state is emitted. onChange is called before the state of the cubit is updated. onChange is a great spot to add logging/analytics for a specific cubit.
inherited
onError(Object error, StackTrace stackTrace) → void
Called whenever an error occurs and notifies BlocObserver.onError.
inherited
onInitialize(Map<String, dynamic> params) FutureOr<void>
onSubmit() FutureOr<void>
removeField(FieldBloc<FieldBlocStateBase> field) → void
removeFields(Iterable<FieldBloc<FieldBlocStateBase>> fields) → void
reset() FutureOr<void>
submit() FutureOr<void>
toString() String
A string representation of this object.
inherited
validate() FutureOr<void>

Operators

operator ==(Object other) bool
The equality operator.
inherited