How to handle call ended event with Agora UIKit and Flutter

Viewed 218

When hitting the end call button (the red one), I am getting this error:
I need to understand How to handle call ended event with Agora UIKit and Flutter

How to handle call ended event

  bool _debugAssertNotDisposed() {
    assert(() {
      if (_debugDisposed) {
        throw FlutterError(
          'A $runtimeType was used after being disposed.\n'
          'Once you have called dispose() on a $runtimeType, it can no longer be used.',
        );
      }
      return true;
    }());
    return true;
  }
2 Answers

There are eventHandlers for everything that agora does. Specifically there is a leaveChannel handler, in that handler you can go to a specific view or page.

Or you can have the video call in a specific page, and then you don't do anything and it returns to the previous page

Update:

Please use the latest version of the Flutter UIKit (v1.0.0) which fixes the endCall error.

AgoraClient client = AgoraClient( agoraEventHandlers: AgoraRtcEventHandlers( leaveChannel: (state) => Navigator.pop(context))),

Related