c2c_flutter_call_kit 0.1.2 c2c_flutter_call_kit: ^0.1.2 copied to clipboard
A Flutter plugin for displaying call screen when app in background or terminated.
import 'package:c2c_flutter_call_kit/connectycube_flutter_call_kit.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
@override
void initState() {
super.initState();
ConnectycubeFlutterCallKit.instance.init(
onCallAccepted: _onCallAccepted,
onCallRejected: _onCallRejected,
);
ConnectycubeFlutterCallKit.showCallNotification(
mettingId: 'mettingId',
uuid: 'uuid',
callType: 1,
callerId: 123,
callerName: 'callerName',
callerAvatar: 'callerAvatar',
opponentsIds: {123},);
ConnectycubeFlutterCallKit.reportCallAccepted(uuid: '1234');
ConnectycubeFlutterCallKit.reportCallEnded(uuid: '1234');
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Text('Running on: $_platformVersion\n'),
),
),
);
}
Future _onCallAccepted(String mettingId,
String uuid,
int callType,
int callerId,
String callerName,
String callerAvatar,
Set<int> opponentsIds,
Map<String, String> userInfo) {}
Future _onCallRejected(String mettingId,
String uuid,
int callType,
int callerId,
String callerName,
String callerAvatar,
Set<int> opponentsIds,
Map<String, String> userInfo) {}
}