Room
Room is the place where the actual meeting takes place. It is the place where the user can interact with other peers.
Name | Type | Description |
---|---|---|
joinRoom() | Function | moves user from lobby to actual room with other peers |
leaveRoom() | Function | removes user from room, back to the lobby |
endRoom() | Function | Ends the room for all, only `host` has the ability to call this function |
Sample Code
meeting_screen.dart
import 'package:flutter/material.dart';
import 'package:huddle01_flutter_client/huddle_client.dart';
class MeetingScreen extends StatefulWidget {
...
}
class _MeetingScreenState extends State<MeetingScreen> {
late HuddleClient huddleClient;
@override
void initState() {
...
}
@override
Widget build(BuildContext context) {
return Column(
children:[
ElevatedButton(
onPressed:(){
huddleClient.joinRoom(roomId);
},
child: const Text("Join Room"),
),
ElevatedButton(
onPressed:(){
huddleClient.leaveRoom();
},
child: const Text("Leave Room"),
),
ElevatedButton(
onPressed:(){
huddleClient.endRoom();
},
child: const Text("End Room"),
),
]
);
}
}