< حزمة واجهات Flutter />
UTD Audio Room Kit
غرف صوتية مباشرة جاهزة بمقاعد ودردشة فورية وأدوات إشراف.
import 'package:utd_audio_room_kit/utd_audio_room_kit.dart';
UTDAudioRoom(
appId: '<utd-app-id>',
appKey: '<utd-app-key>',
userId: 'user123',
userName: 'John Doe',
roomId: 'room456',
roomOwnerId: 'owner789',
);Drop-in
واجهة كاملة
0
خوادم خلفية
EN · AR
دعم لغوي مدمج
PiP
+ تصغير
< utd_audio_room_kit />
أبرز المزايا
حزمة Flutter متكاملة وقابلة للتخصيص لتجارب الغرف الصوتية المباشرة، مدعومة بـ LiveKit ومحرّك UTD Stream. واجهة غرفة جاهزة بإدارة المقاعد، وطلبات التحدّث، وقوائم الأعضاء، والدردشة الفورية، والتحكم في الوسائط، والتصغير/PiP، وإشراف كامل للمضيف/المشرف — دون الحاجة إلى خادم توكنات في الخلفية.
واجهة غرفة صوتية جاهزة — دون أي كود إضافي
إدارة المقاعد: أخذ، مغادرة، تبديل، قفل، فتح، طرد، كتم، تبديل المقاعد
طابور طلبات التحدّث مع قبول/رفض
قائمة أعضاء بإجراءات المضيف/المشرف (كتم، طرد، دعوة، حظر، ترقية/تخفيض)
دردشة فورية عبر قناة البيانات مع تجميع وإزالة التكرار
تحكم في الميكروفون والسمّاعة مع توجيه يفضّل البلوتوث
إعادة اتصال متدرّجة (مزامنة خفيفة <15 ثانية، مزامنة كاملة <60 ثانية)
تصغير إلى نافذة عائمة وصورة-داخل-صورة على نظام أندرويد
تخصيص السمات ودعم لغوي مدمج (الإنجليزية/العربية)
استبدال كامل للأقسام (الترويسة، الرسائل، عناصر التحكم، الخلفية، المقاعد)
دون خادم توكنات خلفي — تدفّق توكنات قائم على appKey
< utd_audio_room_kit />
ابدأ الآن
التثبيت
flutter pub add utd_audio_room_kit< utd_audio_room_kit />
مرجع API
Main widget
The drop-in prebuilt audio-room widget that hosts the full UI and connection lifecycle.
UTDAudioRoomwidgetconst UTDAudioRoom({required String appId, required String appKey, required String userId, required String userName, required String roomId, required String roomOwnerId, Set<String> adminIds, UTDAudioRoomConfig config, List<UTDRoomMode> modes, UTDRoomController? controller, ...})Prebuilt audio-room widget. Mints a token directly from the engine with the publishable appKey (no backend), connects to LiveKit, and renders seats, chat and controls. Self-upgrades admins post-join.
المعاملات
appIdStringمطلوبUTD Stream Engine app ID.
appKeyStringمطلوبPublishable app key (no backend); used to mint tokens via X-App-Key. The server secret never ships.
userIdStringمطلوبLocal user identity.
userNameStringمطلوبLocal user display name.
roomIdStringمطلوبRoom name to join.
roomOwnerIdStringمطلوبIdentity of the room owner; the owner joins as host.
adminIdsSet<String>القيمة الافتراضية = const {}Identities the app treats as admins at join.
adminIdsResolverFuture<Set<String>> Function()?القيمة الافتراضية = nullAsync admin-list source; triggers a non-blocking self-upgrade if it lists the local user.
adminIdsNowSet<String> Function()?القيمة الافتراضية = nullSync admin-list probe used at token time without waiting.
layoutModeStringالقيمة الافتراضية = '3'Room mode id selecting the seat layout / seat count.
configUTDAudioRoomConfigالقيمة الافتراضية = const UTDAudioRoomConfig()Behavior, theming and custom-widget configuration.
modesList<UTDRoomMode>القيمة الافتراضية = const []Custom room modes registered on the controller.
controllerUTDRoomController?القيمة الافتراضية = nullOptional externally-owned controller (e.g. when restoring from minimize).
onControllerReadyvoid Function(UTDRoomController)?القيمة الافتراضية = nullCalled once the controller is created/attached.
onConnectionChangedvoid Function(bool isConnected)?القيمة الافتراضية = nullFired on connect success/failure.
onSeatTapvoid Function(int index, SeatState seat)?القيمة الافتراضية = nullCalled when a seat is tapped.
onSeatChangedvoid Function(List<SeatState> seats)?القيمة الافتراضية = nullCalled whenever seat state changes.
onConnectErrorvoid Function(Object error, StackTrace)?القيمة الافتراضية = nullCalled when the initial connect fails.
Room controller
Top-level controller owning connection, sub-controllers, roles, bans and speaker flows.
UTDRoomControllerconstructorUTDRoomController()Creates the controller and its seat, media, chat, minimize and PiP sub-controllers. Usually created internally by UTDAudioRoom.
initApimethodvoid initApi({String baseUrl, String tokenBaseUrl, String? appId, required String appKey})Initializes the engine and token API clients. Must be called before connect/generateToken. Token issuance and in-room ops use different hosts.
المعاملات
baseUrlStringالقيمة الافتراضية = UTDApiClient.defaultBaseUrlIn-room engine host for seat/speaker/ban/role calls.
tokenBaseUrlStringالقيمة الافتراضية = UTDApiClient.defaultTokenBaseUrlEdge host used for token generation.
appIdString?القيمة الافتراضية = nullEngine app ID.
appKeyStringمطلوبPublishable app key sent as X-App-Key for minting.
connectmethodasyncFuture<void> connect({required String url, required String token, int seatCount = 9, bool enableMicOnJoin = false, bool useSpeaker = true, Map<String,String> userAttributes, String? roomName})Connects to the LiveKit room with the given url/token, initializes seats, wires data/role/ban/chat-lock handlers, and optionally enables the mic and speaker.
المعاملات
urlStringمطلوبLiveKit server URL.
tokenStringمطلوبLiveKit access token.
seatCountintالقيمة الافتراضية = 9Number of seats to initialize.
enableMicOnJoinboolالقيمة الافتراضية = falsePublish the local mic on connect.
useSpeakerboolالقيمة الافتراضية = truePrefer Bluetooth/loudspeaker output on join.
userAttributesMap<String,String>القيمة الافتراضية = const {}Cosmetic LiveKit participant attributes (avatar/frame/etc.).
roomNameString?القيمة الافتراضية = nullRoom name used for seat API calls.
القيمة المُرجَعة: Future<void>
generateTokenmethodasyncFuture<UTDTokenResponse> generateToken({required String identity, required String roomName, required String roomOwnerId, String role = 'audience', String? name, int? seatCount, String? seatMode, int? hostSeat, String? modeId, ...})Requests a LiveKit token from the engine and applies the returned per-user bearer to the in-room clients. Throws UTDBannedException on a 403 banned response.
المعاملات
identityStringمطلوبUser identity.
roomNameStringمطلوبRoom name.
roomOwnerIdStringمطلوبRoom owner identity.
typeStringالقيمة الافتراضية = 'audio_room'Room type.
roleStringالقيمة الافتراضية = 'audience'Requested role (host/admin/audience).
nameString?القيمة الافتراضية = nullDisplay name.
seatCountint?القيمة الافتراضية = nullInitial seat count (host only).
modeIdString?القيمة الافتراضية = nullRoom mode id (host only).
القيمة المُرجَعة: Future<UTDTokenResponse>
leavemethodasyncFuture<void> leave()Leaves the room: tears down listeners, drains any pending mic publish, disconnects LiveKit, and resets minimize/PiP state.
القيمة المُرجَعة: Future<void>
changeRolemethodasyncFuture<UTDRoleChangeResult> changeRole({required String targetIdentity, required String role})Changes a participant's role (owner-only; server returns 403 otherwise). Optimistically caches the result; throws on REST error.
المعاملات
targetIdentityStringمطلوبIdentity whose role changes.
roleStringمطلوبNew role (host/admin/guest/audience).
القيمة المُرجَعة: Future<UTDRoleChangeResult>
banUsermethodasyncFuture<bool> banUser(String identity, {String? reason, int? durationSeconds, bool global = false})Bans a user. Room-scoped by default; pass global true for a project-wide ban and durationSeconds null for permanent. Returns true on success.
المعاملات
identityStringمطلوبUser to ban.
reasonString?القيمة الافتراضية = nullOptional ban reason.
durationSecondsint?القيمة الافتراضية = nullBan duration; null = permanent.
globalboolالقيمة الافتراضية = falseTrue for a project-wide ban.
القيمة المُرجَعة: Future<bool>
lockCommentsmethodasyncFuture<bool> lockComments()Locks room chat so only host/admin may send (host/admin-only). State is confirmed by the server broadcast, not set optimistically.
القيمة المُرجَعة: Future<bool>
requestToSpeakmethodasyncFuture<Map<String,dynamic>?> requestToSpeak()Audience requests to speak (request mode). Returns the API result map, or null on error / when not ready.
القيمة المُرجَعة: Future<Map<String,dynamic>?>
inviteToSpeakmethodasyncFuture<Map<String,dynamic>?> inviteToSpeak(String targetIdentity, {int? seatIndex})Host/admin invites a user to speak, optionally targeting a specific seat. Returns the API result map or null.
المعاملات
targetIdentityStringمطلوبIdentity to invite.
seatIndexint?القيمة الافتراضية = nullTarget seat the invitee is seated on if accepted.
القيمة المُرجَعة: Future<Map<String,dynamic>?>
isConnectedgetterbool get isConnectedTrue when the room connection state is connected.
القيمة المُرجَعة: bool
isHostOrAdmingetterbool get isHostOrAdminWhether the local participant's role is host or admin.
القيمة المُرجَعة: bool
participantsStreamgetterasyncStream<List<UTDParticipant>> get participantsStreamStream of all room participants, emitting on join/leave/attribute/metadata changes.
القيمة المُرجَعة: Stream<List<UTDParticipant>>
roleChangeStreamgetterasyncStream<UTDRoleChangeEvent> get roleChangeStreamStream of role changes for all participants (promotions, demotions, engine auto-corrections).
القيمة المُرجَعة: Stream<UTDRoleChangeEvent>
activeSpeakerspropertyfinal ValueNotifier<Set<String>> activeSpeakersReactive set of identities currently speaking, polled from LiveKit every 300ms.
القيمة المُرجَعة: ValueNotifier<Set<String>>
commentsLockedpropertyfinal ValueNotifier<bool> commentsLockedReactive whether room chat is currently locked (server-driven; never set optimistically).
القيمة المُرجَعة: ValueNotifier<bool>
onBannedcallbackvoid Function(UTDBanNotice notice)? onBannedFired once when the local user is banned from any source (data message, removal, or token 403). Wired internally by UTDAudioRoom.
القيمة المُرجَعة: void Function(UTDBanNotice)?
disposemethodvoid dispose()Releases all resources: timers, subscriptions, notifiers, sub-controllers and API clients.
Seat & stage control
Seat state management; all mutations go through the REST API and apply from server _seat_update messages.
UTDSeatControllerclassUTDSeatController(UTDRoomManager roomManager)Manages reactive seat state. Mutations call the REST API; local state updates only from _seat_update data messages or room _seats metadata.
takeSeatmethodasyncFuture<bool> takeSeat(int index, String userId)Requests microphone (and Bluetooth on Android) permissions then takes the seat at index via the API. State arrives via _seat_update.
المعاملات
indexintمطلوبTarget seat index.
userIdStringمطلوبIdentity taking the seat.
القيمة المُرجَعة: Future<bool>
leaveSeatmethodasyncFuture<bool> leaveSeat(String userId)Leaves the user's current seat via the API.
المعاملات
userIdStringمطلوبIdentity leaving the seat.
القيمة المُرجَعة: Future<bool>
moveSeatmethodasyncFuture<bool> moveSeat(String userId, int targetSeat)Atomically moves the user to another seat via the API.
المعاملات
userIdStringمطلوبIdentity to move.
targetSeatintمطلوبDestination seat index.
القيمة المُرجَعة: Future<bool>
lockSeatmethodasyncFuture<bool> lockSeat(int index, {required String identity})Admin locks the seat at index (host/admin). State arrives via _seat_update.
المعاملات
indexintمطلوبSeat to lock.
identityStringمطلوبActing host/admin identity.
القيمة المُرجَعة: Future<bool>
kickFromSeatmethodasyncFuture<bool> kickFromSeat(int index, {required String identity})Removes the occupant from the seat at index (host/admin only).
المعاملات
indexintمطلوبSeat to vacate.
identityStringمطلوبActing host/admin identity.
القيمة المُرجَعة: Future<bool>
setupSeatsmethodasyncFuture<bool> setupSeats({required String identity, required int seatCount, required String seatMode, String? modeId})Changes seat configuration mid-room (count/mode/modeId) (host/admin only).
المعاملات
identityStringمطلوبActing host/admin identity.
seatCountintمطلوبNew seat count.
seatModeStringمطلوبNew seat mode ('free'/'request').
modeIdString?القيمة الافتراضية = nullNew room mode id.
القيمة المُرجَعة: Future<bool>
seatspropertyfinal ValueNotifier<List<SeatState>> seatsReactive list of all seat states.
القيمة المُرجَعة: ValueNotifier<List<SeatState>>
pendingRequestspropertyfinal ValueNotifier<List<SpeakerRequest>> pendingRequestsReactive list of pending speaker requests (for host/admin UI).
القيمة المُرجَعة: ValueNotifier<List<SpeakerRequest>>
getSeatIndexByUserIdmethodint getSeatIndexByUserId(String userId)Returns the seat index occupied by a user, or -1 if not seated.
المعاملات
userIdStringمطلوبIdentity to look up.
القيمة المُرجَعة: int
isSeatAvailablemethodbool isSeatAvailable(int index, {String? userId})Whether the seat at index is empty, unlocked and not reserved for someone else.
المعاملات
indexintمطلوبSeat index to test.
userIdString?القيمة الافتراضية = nullUser to evaluate reservations against.
القيمة المُرجَعة: bool
Media control
Mic, camera, speaker and Bluetooth-routing controls, kept in sync with server/host-side mutes.
UTDMediaControllerclassUTDMediaController(UTDRoomManager roomManager)Controls mic, camera and speaker state and listens to LiveKit mute/permission events to keep reactive state authoritative.
setMicrophoneEnabledmethodasyncFuture<void> setMicrophoneEnabled(bool enabled)Enables/disables the local mic. Refuses to publish on a non-connected room to avoid the addTransceiver-on-disposed-track crash.
المعاملات
enabledboolمطلوبTarget mic state.
القيمة المُرجَعة: Future<void>
toggleMicrophonemethodasyncFuture<void> toggleMicrophone()Toggles the local microphone on/off.
القيمة المُرجَعة: Future<void>
applyBluetoothAudioRoutingmethodasyncFuture<void> applyBluetoothAudioRouting()Re-applies the Android communication audio config with forceHandleAudioRouting so Bluetooth routing works after connect/publish; iOS uses the AVAudioSession path.
القيمة المُرجَعة: Future<void>
setSpeakerOnmethodasyncFuture<void> setSpeakerOn(bool on)Routes audio to the loudspeaker (true) or earpiece (false).
المعاملات
onboolمطلوبSpeakerphone on/off.
القيمة المُرجَعة: Future<void>
muteAllRemoteAudiomethodvoid muteAllRemoteAudio(bool mute)Mutes/unmutes playback of all remote participants' audio (and enforces it on late-subscribed tracks).
المعاملات
muteboolمطلوبWhether to mute remote audio.
isMicEnabledpropertyfinal ValueNotifier<bool> isMicEnabledReactive local mic state, kept in sync with LiveKit track mute/unmute events.
القيمة المُرجَعة: ValueNotifier<bool>
canPublishpropertyfinal ValueNotifier<bool> canPublishReactive whether the local participant may publish mic/camera; flips false on demotion.
القيمة المُرجَعة: ValueNotifier<bool>
Chat
Room chat send/receive with comment-lock gating and a bounded message buffer.
UTDChatControllerclassUTDChatController(UTDRoomManager roomManager)Sends and receives room chat over the data channel, enforcing the comment-lock gate and capping retained messages at 300.
sendMessagemethodasyncFuture<void> sendMessage(String text, {Map<String,dynamic>? userData})Sends a chat message (trimmed, non-empty). Refused when comments are locked and the local user is not host/admin.
المعاملات
textStringمطلوبMessage body.
userDataMap<String,dynamic>?القيمة الافتراضية = nullOptional extra payload attached to the message.
القيمة المُرجَعة: Future<void>
addDisplayMessagemethodvoid addDisplayMessage(UTDChatMessage message)Appends a message to the local list without sending it (used for system lines).
المعاملات
messageUTDChatMessageمطلوبMessage to display locally.
clearMessagesmethodvoid clearMessages()Clears the local message list.
messagespropertyfinal ValueNotifier<List<UTDChatMessage>> messagesReactive list of chat messages (bounded to the most recent 300).
القيمة المُرجَعة: ValueNotifier<List<UTDChatMessage>>
Configuration & theming
Behavior config, color tokens, localized strings and minimize/PiP options.
UTDAudioRoomConfigconstructorconst UTDAudioRoomConfig({bool showControlsBar = true, bool turnOnMicrophoneWhenJoining = false, bool useSpeakerWhenJoining = true, int hostSeatIndex = 0, UTDRoomTheme theme, UTDRoomStrings? strings, bool enableMinimize = true, Widget? headerWidget, ...})Configures room behavior, theme, strings and custom section/seat builders. Replaces the prebuilt config.
المعاملات
showControlsBarboolالقيمة الافتراضية = trueShow the default controls bar.
showSeatNamesboolالقيمة الافتراضية = trueShow occupant names under seats.
enableMinimizeboolالقيمة الافتراضية = trueAllow minimizing the room to a floating overlay.
turnOnMicrophoneWhenJoiningboolالقيمة الافتراضية = falsePublish the mic on join.
useSpeakerWhenJoiningboolالقيمة الافتراضية = truePrefer speaker/Bluetooth output on join.
hostSeatIndexintالقيمة الافتراضية = 0Seat index reserved for the host.
themeUTDRoomThemeالقيمة الافتراضية = const UTDRoomTheme()Color tokens for the default UI.
stringsUTDRoomStrings?القيمة الافتراضية = nullLocalized strings; null = English defaults.
autoHostMicboolالقيمة الافتراضية = trueAuto-enable the host's mic even if join-mic is false.
autoSeatHostboolالقيمة الافتراضية = trueAuto-seat the host on hostSeatIndex if empty.
headerWidgetWidget?القيمة الافتراضية = nullCustom header replacing the default.
seatBuilderWidget Function(SeatState, double)?القيمة الافتراضية = nullCustom builder for a seat slot.
avatarBuilderWidget Function(String,double,Map<String,String>,bool,int,String)?القيمة الافتراضية = nullCustom occupant avatar builder.
userInRoomAttributesMap<String,String>القيمة الافتراضية = const {}Cosmetic attributes published to other participants.
UTDAudioRoomConfig.hostconstructorfactory UTDAudioRoomConfig.host()Factory preset for a host (microphone on when joining).
resolveStringsmethodUTDRoomStrings resolveStrings()Returns the configured strings or the English defaults.
القيمة المُرجَعة: UTDRoomStrings
UTDRoomThemeconstructorconst UTDRoomTheme({Color background, Color surface, Color onSurface, Color primary, Color danger, Color seatRingSpeaking, Color badgeHost, Color badgeAdmin, Color badgeGuest, Color sheetBackground, Color bubbleBackground, ...})Color tokens for the built-in default UI. Every field has a dark-room default, so const UTDRoomTheme() is a complete theme.
المعاملات
backgroundColorالقيمة الافتراضية = Color(0xFF14121C)Full-screen room background.
primaryColorالقيمة الافتراضية = Color(0xFF6C5CE7)Accent / call-to-action color.
dangerColorالقيمة الافتراضية = Color(0xFFE74C3C)Destructive color (leave/kick/ban).
seatRingSpeakingColorالقيمة الافتراضية = Color(0xFF2ECC71)Ring around an actively-speaking seat.
badgeHostColorالقيمة الافتراضية = Color(0xFFFFA726)Host role badge color.
badgeAdminColorالقيمة الافتراضية = Color(0xFF448AFF)Admin role badge color.
copyWithmethodUTDRoomTheme copyWith({Color? background, Color? primary, Color? danger, ...})Returns a copy of the theme overriding only the supplied color tokens.
القيمة المُرجَعة: UTDRoomTheme
UTDRoomStrings.enconstructorfactory UTDRoomStrings.en()English defaults for all built-in UI labels (seat actions, requests, host panels, comment-lock, templated lines).
UTDRoomStrings.arconstructorfactory UTDRoomStrings.ar()Arabic defaults for all built-in UI labels.
UTDMinimizeConfigconstructorconst UTDMinimizeConfig({VoidCallback? onClose, MiniOverlayBuilder? overlayBuilder, double overlayWidth = 120, double overlayHeight = 120, bool enableOSPip = false, int pipAspectWidth = 1, int pipAspectHeight = 1, ...})Configures the minimize floating overlay and optional Android OS-level Picture-in-Picture (enableOSPip).
المعاملات
onCloseVoidCallback?القيمة الافتراضية = nullCalled when the room is closed from the overlay.
overlayBuilderMiniOverlayBuilder?القيمة الافتراضية = nullCustom floating-overlay builder.
enableOSPipboolالقيمة الافتراضية = falseEnable Android 12+ system PiP in addition to the overlay.
pipAspectWidthintالقيمة الافتراضية = 1PiP aspect ratio numerator.
pipAspectHeightintالقيمة الافتراضية = 1PiP aspect ratio denominator.
Models & enums
Data models for seats, room modes, chat and connection state.
SeatStateclassconst SeatState({required int index, String? occupantUserId, bool isLocked = false, bool isMuted = false, String? reservedFor, Map<String,String> attributes})Immutable (Equatable) state of a single seat: index, occupant, lock/mute flags, reservation and occupant attributes.
المعاملات
indexintمطلوبSeat index (0 = host seat).
occupantUserIdString?القيمة الافتراضية = nullOccupant identity; null = empty.
isLockedboolالقيمة الافتراضية = falseWhether the seat is admin-locked.
isMutedboolالقيمة الافتراضية = falseWhether the occupant's mic is muted.
reservedForString?القيمة الافتراضية = nullIdentity this seat is reserved for.
attributesMap<String,String>القيمة الافتراضية = const {}Occupant cosmetic attributes (avatar, frame, etc.).
SpeakerRequestclassconst SpeakerRequest({required int id, required String identity, String? createdAt})A pending request to speak: id, requester identity and createdAt timestamp.
المعاملات
idintمطلوبRequest id.
identityStringمطلوبRequesting identity.
createdAtString?القيمة الافتراضية = nullCreation timestamp.
RoomSeatStateclassconst RoomSeatState({required int count, required String mode, String? modeId, required List<SeatState> seats, required List<SpeakerRequest> requests})Full seat snapshot from the backend _seats namespace: count, mode, modeId, seats and pending requests.
المعاملات
countintمطلوبSeat count.
modeStringمطلوبSeat mode ('free'/'request').
modeIdString?القيمة الافتراضية = nullRoom mode id.
seatsList<SeatState>مطلوبPer-seat states.
requestsList<SpeakerRequest>مطلوبPending speaker requests.
UTDRoomModeclassconst UTDRoomMode({required String id, required int seatCount, required List<List<int>> rows, double? seatSize, UTDSeatContainerBuilder? containerBuilder, UTDBackgroundBuilder? backgroundBuilder, String? displayName})Defines a seat layout mode: id, seat count, row arrangement and optional custom container/background builders. Identity is its id.
المعاملات
idStringمطلوبUnique mode id (e.g. '3').
seatCountintمطلوبNumber of seats.
rowsList<List<int>>مطلوبSeat-index layout per row.
seatSizedouble?القيمة الافتراضية = nullExplicit seat size override.
containerBuilderUTDSeatContainerBuilder?القيمة الافتراضية = nullCustom seat-grid container builder.
backgroundBuilderUTDBackgroundBuilder?القيمة الافتراضية = nullMode-specific background builder.
computeSeatSizemethoddouble computeSeatSize(double screenWidth)Single source of truth for the seat slot size in logical px, scaled sub-linearly (sqrt) with screen width and clamped to 52–120.
المعاملات
screenWidthdoubleمطلوبAvailable screen width.
القيمة المُرجَعة: double
UTDRoomMode.defaultModefieldstatic const UTDRoomMode defaultModeBuilt-in default mode: id '3', 9 seats in a 1-4-4 layout.
القيمة المُرجَعة: UTDRoomMode
UTDChatMessageclassUTDChatMessage({required String senderUserId, required String senderName, required String text, required DateTime timestamp, Map<String,dynamic> userData, String? messageID})A chat message with sender, text, timestamp, arbitrary userData and an auto-generated messageID. JSON-serializable.
المعاملات
senderUserIdStringمطلوبSender identity.
senderNameStringمطلوبSender display name.
textStringمطلوبMessage body.
timestampDateTimeمطلوبMessage time.
userDataMap<String,dynamic>القيمة الافتراضية = const {}Extra payload (e.g. system-line markers).
messageIDString?القيمة الافتراضية = nullMessage id; auto-generated when omitted.
UTDConnectionStateenumenum UTDConnectionState { disconnected, connecting, connected, reconnecting, error }Room connection state: disconnected, connecting, connected, reconnecting, error.
القيمة المُرجَعة: UTDConnectionState