agora_rtc_wrapper 0.0.11

  • Readme
  • Changelog
  • Example
  • Installing
  • 76

agora_rtc_wrapper pub package #

Simple wrapper utils for agora rtc implementation in flutter

Get started #

Install #

Add dependency #

pub package

dependencies:
  agora_rtc_wrapper: $latest_version

Super simple to use #


class VideoCallScreen extends StatefulWidget {
  final String channelId;

  VideoCallScreen({@required this.channelId});

  @override
  _VideoCallScreenState createState() => _VideoCallScreenState();
}

class _VideoCallScreenState extends State<VideoCallScreen> {
  AgoraRtcWrapper _agoraUtils;
  int joinedUId = -1;

  @override
  void initState() {
    super.initState();
    _agoraUtils =
        AgoraRtcWrapper('Your Agora App Id', onUserJoined: _onUserJoined);
    if (widget.channelId != null && widget.channelId.isNotEmpty) {
      _agoraUtils.joinChannel(widget.channelId);
    }
  }

  void _onUserJoined(int uid, int elapsed) {
    setState(() {
      joinedUId = uid;
    });
  }

  @override
  void dispose() {
    _agoraUtils.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.black,
      appBar: AppBar(
        title: Text('Video Call Test'),
      ),
      body: Stack(
        children: <Widget>[
          joinedUId != -1 ? _agoraUtils.getVideoView(joinedUId) : Container(),
          Positioned(
            right: 0,
            child: SizedBox(
              height: 180,
              width: 150,
              child: _agoraUtils.getSelfVideoView,
            ),
          ),
          _agoraUtils.getDefaultController(
            onCallEnd: () {
              Navigator.pop(context);
            },
            onMute: (isMute) {
              setState(() {
                _agoraUtils.muteAudio(!isMute);
              });
            },
          )
        ],
      ),
    );
  }
}


[0.0.11] #

Initial Open Source release. Example Added Bug Fixed Timer Added

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: VideoCallScreen(
        channelId: 'test',
      ),
    );
  }
}

class VideoCallScreen extends StatefulWidget {
  final String channelId;

  VideoCallScreen({@required this.channelId});

  @override
  _VideoCallScreenState createState() => _VideoCallScreenState();
}

class _VideoCallScreenState extends State<VideoCallScreen> {
  int joinedUId = -1;

  @override
  void initState() {
    super.initState();
    AgoraRtcWrapper.instance.init('Your Agora App Id');
    AgoraRtcWrapper.instance.listen(onUserJoined: _onUserJoined);
    if (widget.channelId != null && widget.channelId.isNotEmpty) {
      AgoraRtcWrapper.instance.joinChannel(widget.channelId);
    }
  }

  void _onUserJoined(int uid, int elapsed) {
    setState(() {
      joinedUId = uid;
    });
  }

  @override
  void dispose() {
    AgoraRtcWrapper.instance.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.black,
      appBar: AppBar(
        title: Text('Video Call Test'),
      ),
      body: Stack(
        children: <Widget>[
          joinedUId != -1
              ? AgoraRtcWrapper.instance.getVideoView(joinedUId)
              : Container(),
          Positioned(
            right: 0,
            child: SizedBox(
              height: 180,
              width: 150,
              child: AgoraRtcWrapper.instance.getSelfVideoView,
            ),
          ),
          AgoraRtcWrapper.instance.getDefaultController(
            onCallEnd: () {
              Navigator.pop(context);
            },
            onMute: (isMute) {
              setState(() {
                AgoraRtcWrapper.instance.muteAudio(!isMute);
              });
            },
          )
        ],
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  agora_rtc_wrapper: ^0.0.11

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:agora_rtc_wrapper/agora_rtc_wrapper.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
55
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:agora_rtc_wrapper/agora_rtc_wrapper.dart that imports:
  • package:agora_rtc_wrapper/src/agora_rtc_wrapper.dart that imports:
  • package:agora_rtc_wrapper/src/impl/entry_stub.impl.dart that imports:
  • package:agora_rtc_wrapper/src/impl/agora_rtc_wrapper.impl.dart that imports:
  • package:agora_rtc_engine/agora_rtc_engine.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:agora_rtc_wrapper/agora_rtc_wrapper.dart that imports:
  • package:agora_rtc_wrapper/src/agora_rtc_wrapper.dart that imports:
  • package:agora_rtc_wrapper/src/impl/entry_stub.impl.dart that imports:
  • package:agora_rtc_wrapper/src/impl/agora_rtc_wrapper.impl.dart that imports:
  • package:agora_rtc_engine/agora_rtc_engine.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:agora_rtc_wrapper/agora_rtc_wrapper.dart that imports:
  • package:agora_rtc_engine/agora_rtc_engine.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:agora_rtc_wrapper/agora_rtc_wrapper.dart that imports:
  • package:agora_rtc_wrapper/src/agora_rtc_wrapper.dart that imports:
  • package:agora_rtc_wrapper/src/impl/entry_stub.impl.dart that imports:
  • package:agora_rtc_wrapper/src/impl/agora_rtc_wrapper.impl.dart that imports:
  • package:agora_rtc_engine/agora_rtc_engine.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • agora_rtc_wrapper that is a package requiring null.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
agora_rtc_engine ^1.0.12 1.0.13 3.0.1-dev.1
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test