FastConnectivityStatusBloc class
- Inheritance
-
- Object
- Bloc<
FastConnectivityStatusBlocState> - BidirectionalBloc<
FastConnectivityStatusBlocEvent, FastConnectivityStatusBlocState> - FastConnectivityStatusBloc
Constructors
- FastConnectivityStatusBloc.new({FastConnectivityStatusBlocState? initialState})
-
factory
Properties
- addEvent → dynamic Function(BlocEvent)
-
Notifies the BloC of a new event which triggers
mapEventToState
. Ifdispose
has already been called, any calls todispatchEvent
will be ignored and will not result in any state changes.no setterinherited -
analyticsEventController
→ BehaviorSubject<
BlocAnalyticsEvent> -
finalinherited
- blocState ↔ FastConnectivityStatusBlocState
-
The current BloC's state.
getter/setter pairinherited
-
cancelableOperations
↔ List<
CancelableOperation> -
The list of cancelable operations.
getter/setter pairinherited
- canInitialize → bool
-
Whether the BloC can be initialized.
no setterinherited
- closed ↔ bool
-
Whether the BloC is closed.
getter/setter pairinherited
-
connectivitySubscription
↔ StreamSubscription<
FastConnectivityStatus> ? -
Subscription to connectivity status updates.
getter/setter pair
- currentState → FastConnectivityStatusBlocState
-
The current BloC's state.
no setterinherited
- dispatchState → dynamic Function(FastConnectivityStatusBlocState)
-
Notifies the BloC of a new state which triggers
onData
.no setterinherited - enableForceBuildEvents → bool
-
Enable force build events, if you want to force the rendering of the
bloc builder.
Indicates if the event-state history should be saved.
finalinherited
-
errorController
→ PublishSubject<
BlocError> -
The error controller.
finalinherited
-
eventStateHistory
→ Map<
FastConnectivityStatusBlocEvent, List< String> > -
The history map that stores the event-state history.
finalinherited
- eventStateHistorySize → int
-
The maximum size of the history. Set it to null to disable the limit.
finalinherited
-
eventSubscriptions
↔ StreamSubscription<
FastConnectivityStatusBlocState> -
The event subscriptions.
getter/setter pairinherited
-
externalEventController
→ PublishSubject<
FastConnectivityStatusBlocEvent> -
The external event controller which is used to control the event stream.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialState → FastConnectivityStatusBlocState?
-
The initial state of the BloC.
finalinherited
-
initialStateBuilder
→ BlocStateBuilder<
FastConnectivityStatusBlocState> ? -
The initial state BloC builder.
finalinherited
-
internalEventController
→ PublishSubject<
BlocEvent> -
The internal event controller which is used to control the event stream.
finalinherited
- isClosed → bool
-
Whether the BloC is closed for dispatching more events.
no setterinherited
- isConnectivityStreamPaused ↔ bool
-
State flag indicating whether the connectivity stream is paused.
getter/setter pair
- isInitialized ↔ bool
-
Whether the BloC is initializing.
getter/setter pairinherited
- isInitializing ↔ bool
-
Whether the BloC is initializing.
getter/setter pairinherited
-
onAnalyticsEvents
→ Stream<
BlocAnalyticsEvent> -
no setterinherited
-
onData
→ Stream<
FastConnectivityStatusBlocState> -
Called whenever the BloC's state is updated.
no setterinherited
-
onError
→ Stream<
BlocError> -
Called whenever the BloC's state is updated.
no setterinherited
-
onEvent
→ Stream<
FastConnectivityStatusBlocEvent> -
Called whenever an event is added to the BloC.
no setterinherited
-
publishers
→ List<
PublishSubject> -
The list of publishers.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stateController
→ BehaviorSubject<
FastConnectivityStatusBlocState> -
The state controller.
finalinherited
- subxList → SubxList
-
finalinherited
- subxMap → SubxMap
-
finalinherited
Methods
-
canClose(
) → bool -
Whether the BloC can be closed.
Override this method to prevent the BloC from closing.
override
-
close(
) → void -
Closes the BloC.
This method should be called when the BloC is no longer needed.
inherited
-
debounce(
BlocDebounceCallback< BlocEvent> function, {Duration delay = const Duration(milliseconds: 300)}) → BlocDebounceCallback<BlocEvent> -
Creates a debounced function that only invokes
function
after adelay
.inherited -
debounceEvent(
BlocEventCallback< FastConnectivityStatusBlocEvent> function, {Duration delay = const Duration(milliseconds: 300)}) → BlocEventCallback<FastConnectivityStatusBlocEvent> -
Debounces an event. The
function
will not be invoked untildelay
.inherited -
disposeConnectivityStream(
) → void - Disposes of the connectivity stream subscription when it's no longer needed, avoiding potential memory leaks.
-
getEventForState(
FastConnectivityStatusBlocState state) → FastConnectivityStatusBlocEvent? -
Returns the event related to the given
state
.inherited -
getInitialState(
) → FastConnectivityStatusBlocState -
Tries to retreive the initial BloC's state.
inherited
-
handleCheckConnectivityEvent(
) → Stream< FastConnectivityStatusBlocState> -
handleConnectivityStatusChanged(
FastConnectivityStatusBlocEventPayload payload) → FastConnectivityStatusBlocState -
handleInitEvent(
FastConnectivityStatusBlocEventPayload? payload) → Stream< FastConnectivityStatusBlocState> -
handleInitializedEvent(
FastConnectivityStatusBlocEventPayload payload) → Stream< FastConnectivityStatusBlocState> -
handleInternalError(
dynamic error, StackTrace stackTrace) → void -
Handles internal errors.
inherited
-
initState(
) → FastConnectivityStatusBlocState -
Optional callback method to initialize the BloC's state.
inherited
-
listenToAppLifecycleChanges(
) → StreamSubscription< FastAppLifecycleBlocState> - Listens to the app's lifecycle changes, pausing or resuming the connectivity stream in response to those changes.
-
listenToConnectivityStatusChanges(
) → StreamSubscription< FastConnectivityStatus> -
mapEventToState(
FastConnectivityStatusBlocEvent event) → Stream< FastConnectivityStatusBlocState> -
Must be implemented when a class extends BidirectionalBloc.
mapEventToState
is called whenever an event is added and will convert that event into a new BloC state. It can yield zero, one or several states for an event.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pauseConnectivityStream(
) → void - Pauses the connectivity status stream if it's not already paused.
-
performCancellableAsyncOperation<
T> (Future< T> opreation) → Future<T?> -
Performs an asynchronous operation and cancels it if the BloC is closed.
inherited
-
resetBloc(
) → void -
inherited
-
resumeConnectivityStream(
) → void - Resumes the connectivity status stream if it has been paused.
-
sampleEvent(
BlocEventCallback< FastConnectivityStatusBlocEvent> function, {Duration delay = const Duration(milliseconds: 300)}) → BlocEventCallback<FastConnectivityStatusBlocEvent> -
inherited
-
setState(
FastConnectivityStatusBlocState nextState) → void -
Set the BloC state.
inherited
-
shouldProcessEventInOrder(
) → bool -
Determines whether a bloc ensures all
events
are processed in the order in which they are received.inherited -
throttle(
BlocThrottleCallback< BlocEvent> function, {Duration duration = const Duration(milliseconds: 300)}) → BlocThrottleCallback<BlocEvent> -
Creates a throttled function that only invokes
function
at most once per everyduration
.inherited -
throttleEvent(
BlocEventCallback< FastConnectivityStatusBlocEvent> function, {Duration duration = const Duration(milliseconds: 300)}) → BlocEventCallback<FastConnectivityStatusBlocEvent> -
Throttles an event. The event will be ignored if it is dispatched within
the specified
duration
. The last event will be dispatched after theduration
has passed.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
transformError(
dynamic error, StackTrace stackTrace) → BlocError? -
Transforms the error before it is emitted.
inherited
-
updateEventStateHistory(
FastConnectivityStatusBlocEvent event, FastConnectivityStatusBlocState nextState) → void -
Updates the event-state history.
The event-state history is used to determine the event related to a
given state.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- hasBeenInstantiated → bool
-
Keeps track if a singleton instance has been created.
no setter
- instance → FastConnectivityStatusBloc
-
no setter
- service ↔ FastConnectivityService?
-
getter/setter pair
Static Methods
-
reset(
) → void
Constants
- debugLabel → const String