voiceos_flutter 0.1.10
voiceos_flutter: ^0.1.10 copied to clipboard
Production-grade Flutter SDK for AI voice calling powered by the VoiceOS Rust AI Voice Engine. Supports FCM, TelecomManager, ConnectionService, AudioRecord/AudioTrack (Android) and PushKit, CallKit, A [...]
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:voiceos_flutter/voiceos_flutter.dart';
import 'screens/home_screen.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize the VoiceOS SDK once at app startup.
// Replace serverUrl with your VoiceOS gateway address.
await VoiceOS.initialize(
const VoiceOSConfig(
serverUrl: 'http://192.168.1.2:8080',
// Dashboard API used for device registration + heartbeats.
// Falls back to serverUrl when omitted.
dashboardApiUrl: 'http://192.168.1.2:3000',
enableCallKit: true,
enablePushKit: true,
debugMode: true,
maxReconnectAttempts: 10,
phoneNumber: '+918608990584',
maxReconnectDelayMs: 30000,
reconnectDelayMs: 1000,
apiKey: 'vos_live_Gm1g4MhDlb2PosSdVssa6jl0JQZinjWR9KoaRKZX45U',
connectionTimeoutMs: 20000,
appVersion: '1.0.0',
projectId: 'cmqz7njiq0005ph6d0ln1rtc8',
// The signed-in user's name, shown in the dashboard's Registered Users.
userName: 'Gokul Krishnan',
// Auto-register this device + keep it online via heartbeats.
autoRegisterDevice: true,
enableHeartbeat: true,
heartbeatIntervalSeconds: 45,
),
);
runApp(const VoiceOSExampleApp());
}
class VoiceOSExampleApp extends StatelessWidget {
const VoiceOSExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'VoiceOS SDK Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(
seedColor: const Color(0xFF6C63FF),
brightness: Brightness.dark,
),
useMaterial3: true,
scaffoldBackgroundColor: const Color(0xFF0A0A0F),
),
home: const HomeScreen(),
);
}
}