zego_uikit_prebuilt_call 3.17.1 zego_uikit_prebuilt_call: ^3.17.1 copied to clipboard
PrebuiltCall is a full-featured call kit that provides a ready-made call invitation, voice/video chat, device detection, etc. Add a voice/video call to your app in minutes.
// Flutter imports:
import 'package:flutter/material.dart';
// Package imports:
import 'package:zego_uikit_prebuilt_call/zego_uikit_prebuilt_call.dart';
import 'package:zego_uikit/zego_uikit.dart';
import 'home_page.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
final navigatorKey = GlobalKey<NavigatorState>();
ZegoUIKit().initLog().then((value) {
runApp(MyApp(
navigatorKey: navigatorKey,
));
});
}
class MyApp extends StatefulWidget {
final GlobalKey<NavigatorState> navigatorKey;
const MyApp({
required this.navigatorKey,
Key? key,
}) : super(key: key);
@override
State<StatefulWidget> createState() => MyAppState();
}
class MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomePage(),
navigatorKey: widget.navigatorKey,
builder: (BuildContext context, Widget? child) {
return Stack(
children: [
child!,
/// support minimizing
ZegoUIKitPrebuiltCallMiniOverlayPage(
contextQuery: () {
return widget.navigatorKey.currentState!.context;
},
),
],
);
},
);
}
}