StoreCurrentBloc class

Inheritance
Available Extensions

Constructors

StoreCurrentBloc(ProfileDatabase profileDatabase, StoreRepository storeRepository)

Properties

first Future<StoreCurrentState>
The first element of this stream. [...]
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
isBroadcast bool
Returns whether the Stream<State> is a broadcast stream. Every Cubit is a broadcast stream.
read-only, inherited
isEmpty Future<bool>
Whether this stream contains any elements. [...]
read-only, inherited
last Future<StoreCurrentState>
The last element of this stream. [...]
read-only, inherited
length Future<int>
The number of elements in this stream. [...]
read-only, inherited
profileDatabase ProfileDatabase
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
single Future<StoreCurrentState>
The single element of this stream. [...]
read-only, inherited
state StoreCurrentState
The current state.
read-only, inherited
storeRepository StoreRepository
final

Methods

add(StoreCurrentEvent event) → void
Notifies the Bloc of a new event which triggers mapEventToState. If close has already been called, any subsequent calls to add will be ignored and will not result in any subsequent state changes.
inherited
addError(Object error, [StackTrace stackTrace]) → void
Notifies the Bloc of an error which triggers onError.
inherited
any(bool test(StoreCurrentState element)) Future<bool>
Checks whether test accepts any element provided by this stream. [...]
inherited
asBroadcastStream({void onListen(StreamSubscription<StoreCurrentState> subscription), void onCancel(StreamSubscription<StoreCurrentState> subscription)}) Stream<StoreCurrentState>
Returns a multi-subscription stream that produces the same events as this. [...]
inherited
asyncExpand<E>(Stream<E> convert(StoreCurrentState event)) Stream<E>
Transforms each element into a sequence of asynchronous events. [...]
inherited
asyncMap<E>(FutureOr<E> convert(StoreCurrentState event)) Stream<E>
Creates a new stream with each data event of this stream asynchronously mapped to a new event. [...]
inherited
cast<R>() Stream<R>
Adapt this stream to be a Stream<R>. [...]
inherited
close() Future<void>
Closes the event and state Streams. This method should be called when a Bloc is no longer needed. Once close is called, events that are added will not be processed. In addition, if close is called while events are still being processed, the Bloc will finish processing the pending events.
@mustCallSuper, inherited
contains(Object needle) Future<bool>
Returns whether needle occurs in the elements provided by this stream. [...]
inherited
distinct([bool equals(StoreCurrentState previous, StoreCurrentState next)]) Stream<StoreCurrentState>
Skips data events if they are equal to the previous data event. [...]
inherited
drain<E>([E futureValue]) Future<E>
Discards all data on this stream, but signals when it is done or an error occurred. [...]
inherited
elementAt(int index) Future<StoreCurrentState>
Returns the value of the indexth data event of this stream. [...]
inherited
emit(StoreCurrentState state) → void
emit should never be used outside of tests. [...]
@visibleForTesting, inherited
every(bool test(StoreCurrentState element)) Future<bool>
Checks whether test accepts all elements provided by this stream. [...]
inherited
expand<S>(Iterable<S> convert(StoreCurrentState element)) Stream<S>
Transforms each element of this stream into a sequence of elements. [...]
inherited
firstWhere(bool test(StoreCurrentState element), {StoreCurrentState orElse()}) Future<StoreCurrentState>
Finds the first element of this stream matching test. [...]
inherited
fold<S>(S initialValue, S combine(S previous, StoreCurrentState element)) Future<S>
Combines a sequence of values by repeatedly applying combine. [...]
inherited
forEach(void action(StoreCurrentState element)) Future
Executes action on each element of this stream. [...]
inherited
getCurrentState() Future<StoreCurrentState>
handleError(Function onError, {bool test(dynamic error)}) Stream<StoreCurrentState>
Creates a wrapper Stream that intercepts some errors from this stream. [...]
inherited
join([String separator = ""]) Future<String>
Combines the string representation of elements into a single string. [...]
inherited
lastWhere(bool test(StoreCurrentState element), {StoreCurrentState orElse()}) Future<StoreCurrentState>
Finds the last element in this stream matching test. [...]
inherited
listen(void onData(StoreCurrentState), {Function onError, void onDone(), bool cancelOnError}) StreamSubscription<StoreCurrentState>
Adds a subscription to the Stream<State>. Returns a StreamSubscription which handles events from the Stream<State> using the provided onData, onError and onDone handlers.
inherited
map<S>(S convert(StoreCurrentState event)) Stream<S>
Transforms each element of this stream into a new stream event. [...]
inherited
mapEventToState(StoreCurrentEvent event) Stream<StoreCurrentState>
Must be implemented when a class extends Bloc. mapEventToState is called whenever an event is added and is responsible for converting that event into a new state. mapEventToState can yield zero, one, or multiple states for an event.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onChange(Change<StoreCurrentState> 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. [...]
@mustCallSuper, inherited
onError(Object error, StackTrace stackTrace) → void
Called whenever an error is thrown within mapEventToState. By default all errors will be ignored and Bloc functionality will be unaffected. The stackTrace argument may be null if the state stream received an error without a stackTrace. A great spot to handle errors at the individual Bloc level. [...]
@mustCallSuper, @protected, inherited
onEvent(StoreCurrentEvent event) → void
Called whenever an event is added to the Bloc. A great spot to add logging/analytics at the individual Bloc level. [...]
@mustCallSuper, @protected, inherited
onTransition(Transition<StoreCurrentEvent, StoreCurrentState> transition) → void
Called whenever a transition occurs with the given transition. A transition occurs when a new event is added and mapEventToState executed. onTransition is called before a Bloc's state has been updated. A great spot to add logging/analytics at the individual Bloc level. [...]
@mustCallSuper, @protected, inherited
pipe(StreamConsumer<StoreCurrentState> streamConsumer) Future
Pipes the events of this stream into streamConsumer. [...]
inherited
reduce(StoreCurrentState combine(StoreCurrentState previous, StoreCurrentState element)) Future<StoreCurrentState>
Combines a sequence of values by repeatedly applying combine. [...]
inherited
singleWhere(bool test(StoreCurrentState element), {StoreCurrentState orElse()}) Future<StoreCurrentState>
Finds the single element in this stream matching test. [...]
inherited
skip(int count) Stream<StoreCurrentState>
Skips the first count data events from this stream. [...]
inherited
skipWhile(bool test(StoreCurrentState element)) Stream<StoreCurrentState>
Skip data events from this stream while they are matched by test. [...]
inherited
take(int count) Stream<StoreCurrentState>
Provides at most the first count data events of this stream. [...]
inherited
takeWhile(bool test(StoreCurrentState element)) Stream<StoreCurrentState>
Forwards data events while test is successful. [...]
inherited
timeout(Duration timeLimit, {void onTimeout(EventSink<StoreCurrentState> sink)}) Stream<StoreCurrentState>
Creates a new stream with the same events as this stream. [...]
inherited
toList() Future<List<StoreCurrentState>>
Collects all elements of this stream in a List. [...]
inherited
toSet() Future<Set<StoreCurrentState>>
Collects the data of this stream in a Set. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
transform<S>(StreamTransformer<StoreCurrentState, S> streamTransformer) Stream<S>
Applies streamTransformer to this stream. [...]
inherited
transformEvents(Stream<StoreCurrentEvent> events, TransitionFunction<StoreCurrentEvent, StoreCurrentState> transitionFn) Stream<Transition<StoreCurrentEvent, StoreCurrentState>>
Transforms the events stream along with a transitionFn function into a Stream<Transition>. Events that should be processed by mapEventToState need to be passed to transitionFn. By default asyncExpand is used to ensure all events are processed in the order in which they are received. You can override transformEvents for advanced usage in order to manipulate the frequency and specificity with which mapEventToState is called as well as which events are processed. [...]
inherited
transformTransitions(Stream<Transition<StoreCurrentEvent, StoreCurrentState>> transitions) Stream<Transition<StoreCurrentEvent, StoreCurrentState>>
Transforms the Stream<Transition> into a new Stream<Transition>. By default transformTransitions returns the incoming Stream<Transition>. You can override transformTransitions for advanced usage in order to manipulate the frequency and specificity at which transitions (state changes) occur. [...]
inherited
where(bool test(StoreCurrentState event)) Stream<StoreCurrentState>
Creates a new stream from this stream that discards some elements. [...]
inherited

Operators

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