RoomManager class

Inheritance
Mixed-in types

Properties

activeParticipants Set<String>
getter/setter pairinherited
aiDelegate ChatAiDelegate
no setteroverride
autoRefreshInterval Duration
no setterinherited
botEnabled bool
final
cacheDelegate ChatCacheDelegate
no setteroverride
canOperate bool
no setterinherited
connection Future<bool>
finalinherited
connectivity Stream<bool>
finalinherited
connectivityDebounce Duration
Debounces rapid connectivity flaps (Wi-Fi transitions, tower hopping). Without this, every flicker would tear down + restart all subscriptions.
no setterinherited
cooldownMinutesRange → (int, int)
Minutes range the bot stays "away" after leaving.
no setterinherited
error bool
getter/setter pairinherited
errorReporter ChatErrorReporter
no setteroverride
failedMessageCount int
Number of failed messages awaiting retry.
no setterinherited
fetchGroupUserProfiles bool
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
invisibilityGracePeriod Duration
no setterinherited
isActive bool
no setterinherited
isConnected bool
no setterinherited
isLoggedIn bool
no setterinherited
isPaused bool
no setterinherited
isRunning bool
no setterinherited
isStarted bool
no setterinherited
leaveMessages List<String>
Pre-written leave messages — one is picked at random. Override to match the bot's personality / language.
no setterinherited
loading bool
getter/setter pairinherited
mappedProfiles Map<String, Profile>
getter/setter pairinherited
mappedRooms Map<String, Room>
getter/setter pairinherited
mappedStatuses Map<String, Status>
getter/setter pairinherited
mappedTypings Map<String, Typing>
getter/setter pairinherited
maxCachedManagers int
final
maxFailedMessageBuffer int
Maximum failed messages to retain. Beyond this, oldest are dropped.
no setterinherited
maxOfflineQueueSize int
Maximum messages to keep in the offline queue. When exceeded, oldest pending messages are dropped (and the user is shown a failed state for those — though those drops are reported via errorReporter).
no setterinherited
me String
no setterinherited
messageDelegate ChatMessageDelegate
no setteroverride
modelConfigs ChatModelConfigs
final
n ChatFieldValueNormalizer
no setteroverride
notificationDelegate ChatNotificationDelegate
no setteroverride
offlineQueueEnabled bool
Whether the offline queue is enabled. App can override to disable in builds where queueing is undesirable.
no setterinherited
pausedDurationWhenAppBackground Duration
finalinherited
pendingMessageCount int
Queue length — useful for UI badge ("3 messages waiting to send").
no setterinherited
pendingMessageCountNotifier ValueListenable<int>
Live notifier — wrap with ValueListenableBuilder in the UI to show a "queued messages" indicator.
no setterinherited
preloadInboxMetadataCount int
final
profileDelegate ChatProfileDelegate
no setteroverride
readDelayRange → (int, int)
Base seconds the bot takes to "read" (before length-extra is added).
no setterinherited
roomDelegate ChatRoomDelegate
no setteroverride
rooms List<Room>
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionMinutesRange → (int, int)
Minutes range before the bot auto-leaves the room.
no setterinherited
settingsDelegate ChatUserSettingsDelegate
no setteroverride
statusDelegate ChatStatusDelegate
no setteroverride
syncTokenEnabled bool
final
thinkDelayRange → (int, int)
Seconds the bot pauses to "think" before starting to type.
no setterinherited
typingDelegate ChatTypingDelegate
no setteroverride
typingGraceSec int
Grace period (sec) after partner stops typing, to let message land.
no setterinherited
typingPollMs int
Poll interval (ms) while waiting for partner to stop typing.
no setterinherited
typingWaitMaxSec int
Max seconds to wait for partner to finish typing.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addParticipants(Room room, Iterable<String> participants) Future<void>
inherited
archive(Room room) Future<void>
inherited
attach(String uid, {bool? connected}) → void
override
background() → void
override
block(Room room, Iterable<String> participants) Future<void>
inherited
botProfileFromRoom(Room? room) BotProfile
inherited
buildActiveParticipants() Set<String>
inherited
cacheProfile(Profile profile) → void
inherited
cancelMetadataIfOrphaned(String uid) → void
inherited
cleanupOrphanedParticipants(Room room) → void
inherited
clearFailedMessages() → void
Clears the failed-message buffer — call on logout.
inherited
clearOfflineQueue() → void
Clears the queue without sending — call on logout.
inherited
connect<T extends Object?>(Room room, OnChatPageOpeningCallback<T> callback, {ValueChanged<String>? onError}) Future<T?>
inherited
connected() → void
inherited
createMessage(Message msg, {ChatSilentNotification notification = const ChatSilentNotification(), VerifyToSendMessage? verifyToSend, OnDeniedToSendMessage? onDeniedToSend}) Future<Message>
inherited
createMessageByBot(Message msg) Future<void>
inherited
createOrGetGroup(String name, {String? id, List<String>? participants, RoomExtra? extra, ChatSilentNotification notification = const ChatSilentNotification()}) Future<Room>
inherited
createOrGetRoom(Room room, {ChatSilentNotification notification = const ChatSilentNotification()}) Future<Room>
inherited
createOrGetThread(List<String> participants, {RoomExtra? extra, ChatSilentNotification notification = const ChatSilentNotification()}) Future<Room>
inherited
delete(String roomId) Future<void>
inherited
deleteMessage(Message msg, {bool deleteBothAsSync = false}) Future<bool>
inherited
deleteMessages(Iterable<Message> messages, {bool deleteBothAsSync = false}) Future<bool>
inherited
detach() → void
override
didChangeAccessibilityFeatures() → void
Called when the system changes the set of currently active accessibility features.
inherited
didChangeAppLifecycleState(AppLifecycleState state) → void
Called when the system puts the app in the background or returns the app to the foreground.
inherited
didChangeLocales(List<Locale>? locales) → void
Called when the system tells the app that the user's locale has changed. For example, if the user changes the system language settings.
inherited
didChangeMetrics() → void
Called when the application's dimensions change. For example, when a phone is rotated.
inherited
didChangePlatformBrightness() → void
Called when the platform brightness changes.
inherited
didChangeTextScaleFactor() → void
Called when the platform's text scale factor changes.
inherited
didChangeViewFocus(ViewFocusEvent event) → void
Called whenever the PlatformDispatcher receives a notification that the focus state on a view has changed.
inherited
didHaveMemoryPressure() → void
Called when the system is running low on memory.
inherited
didPopRoute() Future<bool>
Called when the system tells the app to pop the current route, such as after a system back button press or back gesture.
inherited
didPushRoute(String route) Future<bool>
Called when the host tells the application to push a new route onto the navigator.
inherited
didPushRouteInformation(RouteInformation routeInformation) Future<bool>
Called when the host tells the application to push a new RouteInformation and a restoration state onto the router.
inherited
didRequestAppExit() Future<AppExitResponse>
Called when a request is received from the system to exit the application.
inherited
disconnect(String roomId) → void
inherited
disconnected() → void
inherited
dispose() → void
Discards any resources used by the object.
inherited
disposeAllManagers() → void
inherited
disposeAllRoomNotifiers() → void
inherited
disposeBotMixin() → void
inherited
disposeRoomNotifier(String roomId) → void
inherited
disposeSubscriptions() → void
inherited
drainOfflineQueue() Future<void>
Called when connectivity comes back. Drains the queue in order. Safe to call multiple times — concurrent drain is prevented.
inherited
enqueueMessage(Message msg, {ChatSilentNotification notification = const ChatSilentNotification(), VerifyToSendMessage? verifyToSend, OnDeniedToSendMessage? onDeniedToSend}) Message
Enqueue a message for later send. Returns the message immediately (with status: sending) so the UI can display it optimistically.
inherited
ensureMetadataForRoom(Room room) → void
inherited
ensureMetadataListener(String uid) → void
inherited
extractFriend(List<String> participants) String?
inherited
foreground() → void
override
forward(List<String> targetRoomIds, Message msg, {ChatNewMessageNotification notification = const ChatNewMessageNotification()}) Future<bool>
inherited
generateOrGetThread(Profile profile, List<String> participants, {RoomExtra? extra}) Future<Room>
inherited
handleBotReply(String roomId, List<Message> messages) Future<void>
inherited
handleCancelBackGesture() → void
Called when a predictive back gesture is canceled, indicating that no navigation should occur.
inherited
handleCommitBackGesture() → void
Called when a predictive back gesture is finished successfully, indicating that the current route should be popped.
inherited
handleStartBackGesture(PredictiveBackEvent backEvent) bool
Called at the start of a predictive back gesture.
inherited
handleStatusBarTap() → void
Called when the user taps the status bar on iOS, to scroll a scroll view to the top.
inherited
handleUpdateBackGestureProgress(PredictiveBackEvent backEvent) → void
Called when a predictive back gesture moves.
inherited
invisible(Room room) → void
inherited
isParticipantInAnyRoom(String uid) bool
inherited
isRoomActive(String roomId) bool
inherited
isRoomCreated(String roomId) bool
inherited
isRoomManaged(String roomId) bool
inherited
isTyping(Room? room) bool
inherited
join(Room room) Future<void>
inherited
leave(Room room) Future<void>
inherited
login(String uid, {bool? connected}) → void
logout() → void
manager(String roomId) ChatManager
inherited
managerForRoom(Room room) ChatManager
inherited
managerOrNull(String roomId) ChatManager?
inherited
markAsActive(String? roomId) Future<void>
inherited
markAsOnline(bool isOnline) Future<void>
inherited
markAsTyping(String roomId, bool isTyping) Future<void>
inherited
markDeliveredForRoom(String roomId) Future<void>
inherited
mute(Room room) Future<void>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify() → void
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
notifyManagerRoomDeleted(String roomId) → void
inherited
openRoomFromNotification<T extends Object?>(String roomId, OnChatPageOpeningCallback<T> callback, {ValueChanged<String>? onError}) Future<T?>
inherited
participantsOf(Room room) Set<String>
inherited
paused() → void
override
pin(Room room) Future<void>
inherited
pop(String roomId) → void
inherited
profileFor(String? uid) Profile
inherited
profileForBot(String? uid) BotProfile
inherited
profileForUser(String? uid) UserProfile
inherited
profileFromRoom(Room? room) Profile
inherited
pushNotification({required String roomId, required String msgId, required ChatNotification notification}) Future<void>
inherited
put(Room room) → void
inherited
reconcileMetadata(Set<String> newActives) → void
inherited
registerToken() Future<void>
inherited
remove(Room room) Future<void>
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeParticipants(Room room, Iterable<String> participants) Future<void>
inherited
resetUnseenCount(String roomId) Future<void>
inherited
restrict(Room room, Iterable<String> participants) Future<void>
inherited
retryFailedMessage(String msgId) Future<Message>
Manually retry a specific failed message. Returns the result.
inherited
retryFailedMessages() Future<void>
Auto-retry all failed messages. Called on reconnect / foreground. Safe to call multiple times — concurrent retry is prevented.
inherited
room(String? roomId) Room
inherited
roomNotifier(String roomId) ValueNotifier<Room>
inherited
run() → void
override
sayHello(String friendId, Message message, {Profile? profile, ChatSilentNotification? notification, OnChatPageOpeningCallback<Object?>? callback, VerifyToSendMessage? verifyToSend, OnDeniedToSendMessage? onDeniedToSend}) Future<void>
sendNotification(Message msg, ChatSilentNotification notification) Future<void>
inherited
sendNow(Message msg, {ChatSilentNotification notification = const ChatSilentNotification(), VerifyToSendMessage? verifyToSend, OnDeniedToSendMessage? onDeniedToSend}) Future<Message>
Direct send without queue check. Used by createMessage for online path and by drainOfflineQueue for queued messages.
inherited
sortedParticipants(List<String> participants) List<String>
inherited
startAutoRefresh() → void
inherited
startListening() → void
inherited
startMeProfileListener() → void
inherited
statusFor(String? uid) Status
inherited
statusFromRoom(Room? room) Status
inherited
stop() → void
override
stopAutoRefresh() → void
inherited
stream(String roomId) Stream<List<Message>>
inherited
timestamp(Object? raw) ChatValueTimestamp
inherited
toString() String
A string representation of this object.
inherited
typingFor(String? uid) Typing
inherited
typingsFromRoom(Room? room) List<Typing>
inherited
unarchive(Room room) Future<void>
inherited
unblock(Room room, Iterable<String> participants) Future<void>
inherited
unmute(Room room) Future<void>
inherited
unpin(Room room) Future<void>
inherited
unregisterToken() Future<void>
inherited
unrestrict(Room room, Iterable<String> participants) Future<void>
inherited
update(String roomId, Map<String, dynamic> value) Future<bool>
inherited
updateAllRoomNotifiers() → void
inherited
updateExtra(String roomId, Map<String, dynamic> extra) Future<bool>
inherited
updateMessage(String roomId, String msgId, Map<String, dynamic> value, {Map<String, dynamic> roomValues = const {}, ChatSilentNotification? notification}) Future<bool>
inherited
updateMessageExtra(String roomId, String msgId, Map<String, dynamic> extra) Future<bool>
inherited
updateMessages(String roomId, Map<String, Map<String, dynamic>> values) Future<bool>
inherited
updateNotifiersForParticipant(String uid) → void
inherited
updateProfile(String uid, Map<String, dynamic> value) Future<bool>
inherited
updateProfileExtra(String uid, Map<String, dynamic> extra) Future<bool>
inherited
updateRoomNotifier(String roomId) → void
inherited
userProfileFromRoom(Room? room) UserProfile
inherited
verified(String roomId, [bool value = true]) Future<bool>
inherited
visible(Room room) → void
inherited
wipeToken() Future<void>
inherited

Operators

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

Static Properties

i RoomManager
no setter

Static Methods

init({bool botEnabled = false, bool syncTokenEnabled = false, bool fetchGroupUserProfiles = false, int preloadInboxMetadataCount = 10, int maxCachedManagers = 10, Duration pausedDurationWhenAppBackground = const Duration(minutes: 2), required Future<bool> connection, required Stream<bool> connectivity, required ChatAiDelegate ai, required ChatCacheDelegate cache, required ChatRoomDelegate room, required ChatMessageDelegate message, required ChatStatusDelegate status, required ChatTypingDelegate typing, required ChatProfileDelegate profile, required ChatNotificationDelegate notification, required ChatUserSettingsDelegate settings, required ChatFieldValueNormalizer normalizer, ChatModelConfigs modelConfigs = const ChatModelConfigs(), ChatErrorReporter errorReporter = const DefaultChatErrorReporter()}) → void