OnlineOfflineCubit class
This class is a state management that specifies the online or offline status of users
Constructors
Properties
- channel ↔ WebSocketChannel
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isClosed → bool
-
Whether the bloc is closed.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → OnlineOfflineRepository
-
The current state.
no setterinherited
-
stream
→ Stream<
OnlineOfflineRepository> -
The current stream of states.
no setterinherited
- timerSendData ↔ Timer
-
getter/setter pair
- timerUpdateStatus ↔ Timer
-
getter/setter pair
Methods
-
addError(
Object error, [StackTrace? stackTrace]) → void -
Reports an
error
which triggersonError
with an optional StackTrace.inherited -
checkConnectedSocket(
BuildContext context, String wstUrl, String sseUrl, {String? userId, String? domainName}) → Future - In this function, we first call the api list of users who have been online at least once in the last hour The websocket then connects and sends the project and current user information SSE will then connect and return users online or offline while the software is in use.
-
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.inherited -
disposeOfChannelAndSocket(
) → dynamic - This function is used to dispose timers, websockets and SSE
-
emit(
OnlineOfflineRepository state) → void -
Updates the
state
to the providedstate
.emit
does nothing if thestate
being emitted is equal to the currentstate
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onChange(
Change< OnlineOfflineRepository> change) → void -
Called whenever a
change
occurs with the givenchange
. Achange
occurs when a newstate
is emitted.onChange
is called before thestate
of thecubit
is updated.onChange
is a great spot to add logging/analytics for a specificcubit
.inherited -
onError(
Object error, StackTrace stackTrace) → void -
Called whenever an
error
occurs and notifiesBlocObserver.onError
.inherited -
refresh(
) → dynamic -
toString(
) → String -
A string representation of this object.
inherited
-
updateStatusList(
) → void - This function periodically updates the online-offline status of users
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited