Talk to us
Talk to us
menu

How to Build Video Conferencing Apps with Flutter

How to Build Video Conferencing Apps with Flutter

These days, there are a number of different online meeting platforms that you can use to host your meetings, and the best part is that you can build them yourself! With a little bit of know-how, you can easily create an online meeting platform that is tailored specifically to your needs. In this article, we will show you how to build a Flutter video conferencing app by using ZEGOCLOUD SDK.

Why ZEGOCLOUD SDK for Flutter Video Conferencing Apps

How do you make a video conferencing app flutter? If you’re looking for an easy and affordable way to get started with video conferencing platforms with Flutter, ZEGOCLOUD UIKits is a great option. This all-in-one kit includes everything you need to start online meetings. The kit is very easy to set up and use, and it’s a great way to get started with online meeting platforms if you’re not sure where to start.

ZEGOCLOUD UIKIts included a video conferencing kit for you to build online meeting platforms with flutter in low code. As shown in the figure, the functions provided by the video conference kit include:

  • Multi-user audio/video meeting
  • Adaptive video layouts
  • Real-time sound waves display
  • Customizable UI styles
  • Device management
  • Extendable top/bottom menu bar
  • Customizable conference title
  • Member List
  • Conference join/leave notifications
online meeting platforms

Preparation

  • A ZEGOCLOUD developer account–Sign up
  • Flutter 1.12 or later.
  • Basic understanding of Flutter development

UIKits SDK integration

Create Project

First, you need to create a new project through Android Studio and create a new App project through File -> New -> New Flutter Project.

create online meeting platforms project

Import SDK

Next, you need to import video conference SDK, run the following code in your project root directory:

flutter pub add zego_uikit_prebuilt_video_conference
import SDK

Implement Video Conference

Next, you need to use ZegoUIKitPrebuiltVideoConference to build an online meeting page.

import 'package:zego_uikit_prebuilt_video_conference/zego_uikit_prebuilt_video_conference.dart';

class VideoConferencePage extends StatelessWidget {
  final String conferenceID;

  const VideoConferencePage({required this.conferenceID, super.key});

  @override
  Widget build(BuildContext context) {
    return ZegoUIKitPrebuiltVideoConference(
        appID: yourAppID, // Fill in the appID that you get from ZEGOCLOUD Admin Console.
        appSign: yourAppSign, // Fill in the appSign that you get from ZEGOCLOUD Admin Console.
        conferenceID: conferenceID,
        userID: 'user_id',
        userName: "user_name",
        config: ZegoUIKitPrebuiltVideoConferenceConfig());
  }
}

Now, you can make an online conference by navigating to this VideoConferencePage.

Navigator.push(
    context,
    MaterialPageRoute(builder: (context) {
        return VideoConferencePage(
            conferenceID: "conference_id",
        );
    }),
);

Here is all the code for the demo

import 'dart:math';

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

final localUserID = Random().nextInt(1000).toString();

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: HomePage());
  }
}

class HomePage extends StatefulWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  State<StatefulWidget> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  /// Users who use the same conferenceID can in the same conference.
  var conferenceDTextCtrl = TextEditingController(text: "video_conference_id");

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 10),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Expanded(
                child: TextFormField(
                  controller: conferenceDTextCtrl,
                  decoration: const InputDecoration(
                      labelText: "join a conference by id"),
                ),
              ),
              ElevatedButton(
                  onPressed: () {
                    Navigator.push(
                      context,
                      MaterialPageRoute(builder: (context) {
                        return VideoConferencePage(
                          conferenceID: conferenceDTextCtrl.text,
                        );
                      }),
                    );
                  },
                  child: const Text("join"))
            ],
          ),
        ),
      ),
    );
  }
}

class VideoConferencePage extends StatelessWidget {
  final String conferenceID;

  const VideoConferencePage({required this.conferenceID, super.key});

  @override
  Widget build(BuildContext context) {
    return ZegoUIKitPrebuiltVideoConference(
        appID: yourAppID,
        // Fill in the appID that you get from ZEGOCLOUD Admin Console.
        appSign: yourAppSign,
        // Fill in the appSign that you get from ZEGOCLOUD Admin Console.
        conferenceID: conferenceID,
        userID: 'user_id',
        userName: "user_name",
        config: ZegoUIKitPrebuiltVideoConferenceConfig());
  }
}

Configure your online meeting platforms

Android :

  1. Open the your_project/android/app/build.gradle file, and modify the compileSdkVersion to 33.
config android sdk version
  1. Next, you need to add device permissions. open the your_project/app/src/main/AndroidManifest.xml file, and add the following code:
   <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
   <uses-permission android:name="android.permission.RECORD_AUDIO" />
   <uses-permission android:name="android.permission.INTERNET" />
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
   <uses-permission android:name="android.permission.CAMERA" />
   <uses-permission android:name="android.permission.BLUETOOTH" />
   <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.READ_PHONE_STATE" />
   <uses-permission android:name="android.permission.WAKE_LOCK" />
config android permission
  1. To prevent obfuscation of the SDK public class names, do the following:
  • In your project’s your_project > android > app folder, create a proguard-rules.pro file with the following content as shown below:
   -keep class **.zego.** { *; }
  • Add the following config code to the release part of the your_project/android/app/build.gradle file.
   proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
config android proguard

iOS :

  1. You need to add app permissions. open your_project/ios/Runner/Info.plist, and add the following code:
<key>NSCameraUsageDescription</key>
<string>We require camera access to connect to a video conference</string>
<key>NSMicrophoneUsageDescription</key>
<string>We require microphone access to connect to a video conference</string>
config ios permission

Run a Demo

After completing all the steps, you can start running your project and experience your own online meeting platforms. So hurry up and get started! You can download the sample demo source code of this article to start building online meeting platforms with Flutter.

Conclusion

Online meeting platforms are a great way to stay connected with colleagues, clients, and customers. They are easy to use and allow for real-time collaboration. However, many of the popular platforms are proprietary and can be expensive to use. To avoid these costs, you can build video conferencing apps with Flutter with ZEGOCLOUD SDK. If you are looking for a deeper requirement for your Flutter video conferencing app building, ZEGOCLOUD comes with a fully customized video call SDK as well. Sign up and try it now!

Read more:

Talk to Expert

Learn more about our solutions and get your question answered.

Talk to us

Take your apps to the next level with our voice, video and chat APIs

Free Trial
  • 10,000 minutes for free
  • 4,000+ corporate clients
  • 3 Billion daily call minutes

Stay updated with us by signing up for our newsletter!

Don't miss out on important news and updates from ZEGOCLOUD!

* You may unsubscribe at any time using the unsubscribe link in the digest email. See our privacy policy for more information.