CompositeChatRealtime class
Merges several ChatRealtime sources into one.
Built for SignalR + FCM running side by side: the hub carries live, in-app events while the app is open and connected; FCM's push channel is the only one of the two that still reaches the user while the app is backgrounded or the hub is unreachable. Callers — the message controller, the conversation list, presence — see one ChatRealtime and do not need to know how many transports actually feed it, so adding or removing a source is a one-line change in ChatLibsRF.server rather than a change to every listener.
Events and Status are the union of every source's stream, unchanged and untagged — a consumer that only cares "did something happen" (as every current listener does) needs nothing more. CurrentStatus and IsConnected report the best status among the sources rather than requiring all of them, since one transport being down must not make the app look offline while the other still works.
JoinGroup/LeaveGroup/Connect/Disconnect fan out to every source and
swallow individual failures — precisely what every existing call site
already does for a single ChatRealtime (.catchError(...)), just
applied per source instead of assuming there is only one.
- Implemented types
Constructors
-
CompositeChatRealtime(List<
ChatRealtime> Sources)
Properties
- CurrentStatus → ChatRealtimeStatus
-
Connected if any source is; otherwise reconnecting or connecting if any
source is; disconnected only once every source is.
no setteroverride
-
Events
→ Stream<
ChatRealtimeEvent> -
Events from the server. Broadcast, so several listeners may subscribe.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- IsConnected → bool
-
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Sources
→ List<
ChatRealtime> -
final
-
Status
→ Stream<
ChatRealtimeStatus> -
Connection state changes.
no setteroverride
Methods
-
Connect(
) → Future< void> -
Opens the connection. Safe to call when already connected.
override
-
Disconnect(
) → Future< void> -
override
-
Dispose(
) → Future< void> -
Closes the connection and releases the streams.
override
-
JoinGroup(
String chatGroupId) → Future< void> -
Scopes this connection to a conversation, where the server requires it.
override
-
LeaveGroup(
String chatGroupId) → Future< void> -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited