Quickstart
Installing the packages
To get started with the Huddle01 Flutter SDK, you can install the package using npm or yarn:
flutter pub add huddle01_flutter_client
Creating a room
import 'dart:convert';
import 'package:http/http.dart' as http;
//Auth token we will use to generate a meeting and connect to it
String apiKey = "<Generated-from-docs>";
// API call to create meeting
Future<String> createMeeting() async {
final http.Response httpResponse = await http.post(
Uri.parse("https://api.huddle01.com/api/v1/create-room"),
headers: {'Authorization': apiKey},
);
//Destructuring the roomId from the response
return json.decode(httpResponse.body)['roomId'];
}
Initializing the SDK
After installing the package, you can initialize the SDK by using the useHuddle01
hook:
import 'package:huddle01_flutter_client/huddle01_flutter_client.dart';
String projectId = 'YOUR-PROJECT-ID';
String roomId = 'YOUR-ROOM-ID';
// Initialize your huddleClient
HuddleClient huddleClient = HuddleClient(projectId);
// Join Room
huddleClient.joinRoom(roomId, token);