onHangUpConfirmation property

ZegoCallHangUpConfirmationCallback? onHangUpConfirmation
getter/setter pair

Confirmation callback method before hang up the call.

If you want to perform more complex business logic before exiting the call, such as updating some records to the backend, you can use the onLeaveConfirmation parameter to set it. This parameter requires you to provide a callback method that returns an asynchronous result. If you return true in the callback, the prebuilt page will quit and return to your previous page, otherwise it will be ignored.

Sample Code:

onHangUpConfirmation: (
    ZegoCallHangUpConfirmationEvent event,
    /// defaultAction to return to the previous page
    Future<bool> Function() defaultAction,
) {
  debugPrint('onHangUpConfirmation, do whatever you want');

  /// you can call this defaultAction to return to the previous page,
  return defaultAction.call();
}

Implementation

ZegoCallHangUpConfirmationCallback? onHangUpConfirmation;