Skip to main content
Android
iOS
macOS
Web
Windows
Electron
Flutter
React Native
React JS
Unity
Unreal Engine
Unreal (Blueprint)

Compile and run a sample project

Agora provides open-source sample projects on GitHub to demonstrate the implementation of basic and advanced Video SDK features.

This page shows how to compile, configure, and run the Video SDK Flutter sample project.

Prerequisites

  • Flutter 2.10.5 or higher

  • Dart 2.14.0 or higher

  • Android Studio, IntelliJ, VS Code, or any other IDE that supports Flutter, see Set up an editor.

  • Prepare your development and testing environment according to your target platform:

    Target platformEnvironment requirements
    Android
    • macOS 10.15 or later
    • Windows 10 or higher
    • Latest version of Android Studio
    • Two Android devices
    iOS
    • macOS 10.15 or later
    • Latest version of Xcode
    • Two iOS devices
    macOS
    • macOS 10.15 or later
    • Latest version of Xcode
    • Two macOS devices
    Windows
    • Windows 10 or higher
    • Latest version of Visual Studio
    • Two Windows devices
  • If you are developing a desktop application for Windows, macOS or Linux, make sure your development device meets the Flutter desktop development requirements.

    Information
    Run the flutter doctor command to confirm that your development environment is set up correctly for Flutter development.
  • A camera and a microphone
  • A valid Agora account and project
  • Installed Git

Project setup

Get the sample project

Run the following command to clone the repository locally:

git clone git@github.com:AgoraIO-Extensions/Agora-Flutter-SDK.git
Copy

This repository contains the following sample projects for Agora Flutter Video SDK:

DescriptionPath
Basic functions/example/lib/examples/basic
Advanced features/example/lib/examples/advanced

Configure the sample project

  1. Install dependencies

    In the project root directory, run the following command to install the dependencies:

    flutter pub get
    Copy
  2. Set the App ID and Token

    Open the /example/lib/config/agora.config.dart file, fill in the defaultValue for the App ID, channel name, and temporary token you obtained from Agora Console.

    String get appId {
    return '<TEST_APP_ID>';
    }

    String get token {
    return '<TEST_TOKEN>';
    }

    String get channelId {
    return '<TEST_CHANNEL_ID>';
    }
    Copy

Run the sample project

  1. Connect the target device to your computer.

  2. Open terminal and navigate to the /examples directory.

  3. Execute the following command to launch the sample project on available devices:

    flutter run
    Copy
  4. After compilation is complete, you see the following application on your device:

  5. Select a demo you want to experience from the menu. Choose JoinChannelVideo under Basic as an example. Enter the channel name you specified when generating the temporary token in Channel ID, and click Join channel.

  6. To test various audio and video interaction scenarios, connect to the Agora web demo, or install and run the sample project on a second device. Make sure you use the same app ID on both devices. When you join the same channel from two devices, you can see and hear each other.

vundefined