connect

connect

connect

FlutterDevs Quick Stats

150+

Open Source Contribution

10+

Flutter Custom Plugin

200+

Blogs

5+

Session & Meetups

50+

Project Delivered

10+

Years Mobility Experience

30+

Flutter Expert

50+

Themes

Awards Winning Teams

Google Devfest Speakers

Video Calling In Flutter

agora_rtc_engine | Flutter Package

中文 This Flutter plugin is a wrapper for Agora Video SDK. Agora.io provides building blocks for you to add real-time…

pub. dev

Table Of Contents::

Introduction:

Demo Module ::

Image for post

Image for post

Demo Screens

Setup:

Image for post

Image for post

Image for post

Image for post

Image for post

Image for post

Implementation:

agora_rtc_engine: ^3.1.3
permission_handler: ^5.0.1
import 'package:agora_rtc_engine/rtc_engine.dart';
import 'package:permission_handler/permission_handler.dart';
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

Device Permission:

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- The Agora SDK requires Bluetooth permissions in case users are using Bluetooth devices.-->
<uses-permission android:name="android.permission.BLUETOOTH" />

How to implement code in dart file :

const APP_ID = Your App_ID
const Token = Your Token
Row(
  children: <Widget>[
    Expanded(
        child: TextField(
      controller: _channelController,
      decoration: InputDecoration(
        errorText:
            _validateError ? 'Channel name is mandatory' : null,
        border: UnderlineInputBorder(
          borderSide: BorderSide(width: 1),
        ),
        hintText: 'Channel name',
      ),
    ))
  ],
),
Padding(
  padding: const EdgeInsets.symmetric(vertical: 20),
  child: Row(
    children: <Widget>[
      Expanded(
        child: RaisedButton(
          onPressed: onJoin,
          child: Text('Join'),
          color: Colors.blueAccent,
          textColor: Colors.white,
        ),
      )
    ],
  ),
)
Future<void> onJoin() async {
  setState(() {
    _channelController.text.isEmpty
        ? _validateError = true
        : _validateError = false;
  });
  if (_channelController.text.isNotEmpty) {
    await _handleCameraAndMic(Permission.camera);
    await _handleCameraAndMic(Permission.microphone);
    await Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => VideoCall(
          channelName: _channelController.text,
          role: _role,
        ),
      ),
    );
  }
}
Image for post

Image for post

Final Output

Code File:

Conclusion:

Flutter is a cross-platform development framework made by Google to permit a single codebase for the two iOS and Android applications. In every case, it’s better to communicate vis-à-vis as opposed to a textual discussion; it has an amazing effect on the subsequent individual. Likewise, present-day applications are additionally developing by making next edge highlights like having an ever-increasing number of approaches to allow users to associate with one another.

Post a Comment