API | Description |
Create a SeatGridController object | |
Create a SeatGridWidget object | |
Open the local microphone | |
Close the local microphone | |
Pause publishing local audio stream | |
Resume publishing local audio stream | |
Anchor creates a live room and starts streaming. | |
Anchor stops streaming and destroys the live room. | |
Audience joins an anchor's live streaming room. | |
Audience leaves an anchor's live streaming room. | |
Update the seat mode of the room. | |
Anchor responds to microphone application / Audience responds to microphone invitation | |
Anchor cancels microphone invitation / Audience cancels microphone application | |
Become a speaker. | |
Move the seat. | |
Leave the seat. | |
Anchor invites users to speak. | |
Anchor removes a user from the seat. | |
Anchor locks the seat (including position lock, audio status lock and video status lock) | |
Anchor sets the layout mode of the seat list. | |
Set event callback | |
Remove event callback |
SeatGridController. SeatGridController is responsible for providing APIs for the voice chat room scenario.SeatGridController()
SeatGridWidget. SeatGridWidget is responsible for rendering the seat UI.SeatGridWidget({super.key,required this.controller,this.seatWidgetBuilder,this.onSeatWidgetTap});
Parameter | Type | Meaning |
key | Key? | How does Flutter control replacing the parameters of an old widget with a new widget |
controller | Controller of SeatGridWidget, responsible for providing APIs in the live voice room scenario | |
seatWidgetBuilder | Constructor of the custom seat widget | |
onSeatWidgetTap | Callback for seat click event |
Future<TUIActionCallback> startMicrophone()
void stopMicrophone()
Future<TUIActionCallback> muteMicrophone()
Future<TUIActionCallback> unmuteMicrophone()
Future<TUIValueCallBack<TUIRoomInfo>> startVoiceRoom(TUIRoomInfo roomInfo)
Parameter | Type | Meaning |
roomInfo | Information of creating a live streaming room |
Future<TUIActionCallback> stopVoiceRoom()
Future<TUIValueCallBack<TUIRoomInfo>> joinVoiceRoom(String roomId)
Parameter | Type | Meaning |
roomId | String | Live Streaming Room ID |
Future<TUIActionCallback> leaveVoiceRoom()
Future<TUIActionCallback> updateRoomSeatMode(TUISeatMode seatMode)
Parameter | Type | Meaning |
seatMode | Free to Take: In free-speaking mode, the audience can freely join the podium without applying. applyToTake: Audience become speakers only after the broadcaster agrees. |
Future<TUIActionCallback> responseRemoteRequest(String userId, bool agree)
Parameter | Type | Meaning |
userId | String | User ID that responds to the user. If the current identity is an audience, the ID can be left blank. |
agree | bool | Whether to accept requests: true for accept, false for deny requests |
Future<TUIActionCallback> cancelRequest(String userId)
Parameter | Type | Meaning |
userId | String | User ID to be cancelled. If the current identity is an audience, the ID can be left blank. |
Future<RequestCallback> takeSeat(int seatIndex, int timeout)
Parameter | Type | Meaning |
index | int | Microphone position ID for speaking |
timeout | int | Timeout period, in seconds. If set to 0, the SDK will not perform timeout detection or trigger a timeout callback. |
Future<TUIActionCallback> moveToSeat(int index)
Parameter | Type | Meaning |
index | int | Microphone position ID that needs to be moved to |
Future<TUIActionCallback> leaveSeat()
Future<RequestCallback> takeUserOnSeatByAdmin(int seatIndex, String userId, int timeout)
Parameter | Type | Meaning |
index | int | Invited microphone position ID |
userId | String | ID of the invited user |
timeout | int | Timeout period, in seconds. If set to 0, the SDK will not perform timeout detection or trigger a timeout callback. |
Future<TUIActionCallback> kickUserOffSeatByAdmin(String userId)
Parameter | Type | Meaning |
userId | String | User ID of the kicked-off user |
Future<TUIActionCallback> lockSeat(int index, TUISeatLockParams lockMode)
Parameter | Type | Meaning |
seatIndex | int | The microphone position ID that needs to be locked. |
lockMode | Microphone Mute Parameters |
void setLayoutMode(LayoutMode layoutMode, SeatWidgetLayoutConfig? layoutConfig)
Parameter | Type | Meaning |
layoutMode | The layout mode of the seat position list supports focus layout, grid layout, vertical layout, and free layout. | |
layoutConfig | Layout configuration information only takes effect in free layout mode. |
void addObserver(SeatGridWidgetObserver observer)
Parameter | Type | Meaning |
observer | Callback object of the core component |
void removeObserver(SeatGridWidgetObserver observer)
Parameter | Type | Meaning |
observer | Callback object of the core component |
Type | Meaning |
Custom seat widget constructor | |
Seat click event | |
Received room destruction event | |
Received event of being removed from room | |
Received request event to speak / Received invitation to speak event | |
Event of request to speak / invitation to speak being canceled | |
Received event of user removed from microphone | |
User audio status change event. | |
The layout mode of the seat position list supports focus layout, grid layout, vertical layout, and custom layout. | |
Alignment mode of seat layout | |
Request type (apply for microphone mode and invitation to speak) | |
Request result type | |
Request result callback | |
Seat layout configuration information | |
Seating layout row layout configuration information |
widgettypedef SeatWidgetBuilder = Widget Function(BuildContext context,ValueNotifier<TUISeatInfo> seatInfoNotifier,ValueNotifier<int> volumeNotifier);
Parameter | Type | Meaning |
context | BuildContext | Context |
seatInfoNotifier | Seat information notifier | |
volumeNotifier | ValueNotifier<int> | Volume information notifier |
typedef OnSeatWidgetTap = void Function(TUISeatInfo seatInfo);
Parameter | Type | Meaning |
seatInfo | Microphone position information |
typedef OnRoomDismissed = void Function(String roomId);
Parameter | Type | Meaning |
roomId | String | room ID |
typedef OnKickedOutOfRoom = void Function(String roomId, TUIKickedOutOfRoomReason reason, String message);
Parameter | Type | Meaning |
roomId | String | room ID |
reason | TUIKickedOutOfRoomReason | Reason for being kicked out |
message | String | Kicked-out info |
typedef OnSeatRequestReceived = void Function(RequestType type, TUIUserInfo userInfo);
Parameter | Type | Meaning |
type | Request Type | |
userInfo | Requester Information |
typedef OnSeatRequestCancelled = void Function(RequestType type, TUIUserInfo userInfo);
Parameter | Type | Meaning |
type | Request Type | |
userInfo | Operator Information |
typedef OnKickedOffSeat = void Function(TUIUserInfo userInfo);
Parameter | Type | Meaning |
userInfo | Operator Information |
typedef OnUserAudioStateChanged = void Function(TUIUserInfo userInfo, bool hasAudio, TUIChangeReason reason);
Parameter | Type | Meaning |
userInfo | Operator Information | |
hasAudio | bool | Whether there is an audio stream |
reason | Reason for audio stream change |
Enumeration Value | Meaning |
focus | Focus on layout |
grid | Grid layout |
vertical | Vertical layout |
free | Custom Layout |
Enumeration Value | Meaning |
start | Move the seat closer to the starting position |
end | Move the seat closer to the ending position |
center | Move the seat closer to the intermediate position |
spaceBetween | Do not leave space before the first seat and after the last seat. Evenly distribute the remaining space between other seats. |
spaceAround | Distribute half of the space before the first seat and after the last seat. Evenly distribute the remaining space between other seats. |
spaceEvenly | Evenly distribute the remaining space between all seats. |
Enumeration Value | Meaning |
applyToTakeSeat | Request to speak |
inviteToTakeSeat | Invitation to speak |
Enumeration Value | Meaning |
onAccepted | The request is accepted. |
onRejected | Request rejected. |
onCancelled | The request is canceled. |
onTimeout | Request timeout |
onError | Request anomaly |
Attribute | Type | Meaning |
code | Error Code Enumeration | |
message | String | Error code information |
type | Request result type | |
userInfo | Request Processor |
Attribute | Type | Meaning |
count | int | Microphone Quantity Displayed in This Row |
seatSpacing | double | Seat Horizontal Spacing in This Row (This Parameter Is Valid Only When the Alignment Mode Is START, END, and CENTER) |
seatSize | Size | Seat Layout Size in This Row |
alignment | Alignment mode of layout in this row |
Required | Type | Description |
rowConfigs | Configuration information list of all rows in seat layout | |
rowSpacing | double | Line Spacing in Seat Layout |
Event List | Type | Meaning |
onRoomDismissed | Received room destruction event | |
onKickedOutOfRoom | Received event of being removed from room | |
onSeatRequestReceived | Received request event to speak / Received invitation to speak event | |
onSeatRequestCancelled | Event of request to speak / invitation to speak being canceled | |
onKickedOffSeat | Received event of user removed from microphone | |
onUserAudioStateChanged | User audio status change event |
Feedback