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 platform Environment 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.
InformationRun theflutter doctor
command to confirm that your development environment is set up correctly for Flutter development.
- A computer with Internet access. If a firewall is deployed in your network environment, refer to Connect through restricted networks with Cloud Proxy to use Agora services normally.
- 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:
This repository contains the following sample projects for Agora Flutter Video SDK:
Description | Path |
---|---|
Basic functions | /example/lib/examples/basic |
Advanced features | /example/lib/examples/advanced |
Configure the sample project
-
Install dependencies
In the project root directory, run the following command to install the dependencies:
-
Set the App ID and Token
Open the
/example/lib/config/agora.config.dart
file, fill in thedefaultValue
for the App ID, channel name, and temporary token you obtained from Agora Console.
Run the sample project
-
Connect the target device to your computer.
-
Open terminal and navigate to the
/examples
directory. -
Execute the following command to launch the sample project on available devices:
-
After compilation is complete, you see the following application on your device:
-
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.
-
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.