agora_rtc_wrapper 0.0.10 copy "agora_rtc_wrapper: ^0.0.10" to clipboard
agora_rtc_wrapper: ^0.0.10 copied to clipboard

outdated

Simple wrapper utils for agora rtc implementation in flutter

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
likes
20
pub points
0%
popularity

Publisher

verified publisherdeepqtech.com

Simple wrapper utils for agora rtc implementation in flutter

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

agora_rtc_engine, flutter

More

Packages that depend on agora_rtc_wrapper