OnlineOfflineCubit class

This class is a state management that specifies the online or offline status of users

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 triggers onError 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 provided state. emit does nothing if the state being emitted is equal to the current state.
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 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
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