splive 2.0.0 copy "splive: ^2.0.0" to clipboard
splive: ^2.0.0 copied to clipboard

Official Flutter SDK for Specular.Live voice, video, chat and realtime communication.

example/main.dart

import 'package:flutter/material.dart';
import 'package:splive/splive.dart';

void main() {
  runApp(const MaterialApp(home: SdkExamplePage()));
}

class SdkExamplePage extends StatefulWidget {
  const SdkExamplePage({super.key});

  @override
  State<SdkExamplePage> createState() => _SdkExamplePageState();
}

class _SdkExamplePageState extends State<SdkExamplePage> {
  final sdk = SpliveSdk();

  Future<void> connect() {
    return sdk.connect(
      const SpliveSessionConfig(
        serverUrl: 'wss://YOUR_LIVEKIT_SERVER',
        accessToken: 'TOKEN_FROM_YOUR_BACKEND',
        roomId: 'ROOM_ID',
        userId: 'USER_ID',
        displayName: 'Display Name',
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: FilledButton(onPressed: connect, child: const Text('Connect')),
      ),
    );
  }

  @override
  void dispose() {
    sdk.dispose();
    super.dispose();
  }
}
0
likes
130
points
30
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Official Flutter SDK for Specular.Live voice, video, chat and realtime communication.

Homepage
Repository (GitHub)

License

MIT (license)

Dependencies

flutter, http, livekit_client, web_socket_channel

More

Packages that depend on splive