makeVideoCall function

dynamic makeVideoCall(
  1. Rx<ProfileDetails> profile,
  2. Rx<AvailableFeatures> availableFeatures
)

Implementation

makeVideoCall(
    Rx<ProfileDetails> profile, Rx<AvailableFeatures> availableFeatures) async {
  if (profile.value.isAdminBlocked.checkNull()) {
    toToast(getTranslated("adminBlockedUser"));
    return;
  }
  if (profile.value.isBlocked.checkNull()) {
    showBlockStatusAlert(makeVideoCall, profile, availableFeatures);
    return;
  }
  if (!availableFeatures.value.isGroupCallAvailable.checkNull()) {
    DialogUtils.showFeatureUnavailable();
    return;
  }
  if ((await Mirrorfly.isOnGoingCall()).checkNull()) {
    debugPrint("#Mirrorfly Call You are on another call");
    toToast(getTranslated("msgOngoingCallAlert"));
    return;
  }
  if (!(await AppUtils.isNetConnected())) {
    toToast(getTranslated("noInternetConnection"));
    return;
  }
  // if (await AppUtils.isNetConnected()) {
  if (await AppPermission.askVideoCallPermissions()) {
    // if ((await Mirrorfly.isOnGoingCall()).checkNull()) {
    //   debugPrint("#Mirrorfly Call You are on another call");
    //   toToast(getTranslated("msgOngoingCallAlert"));
    // } else {
    Mirrorfly.makeVideoCall(
        toUserJid: profile.value.jid.checkNull(),
        flyCallBack: (FlyResponse response) {
          if (response.isSuccess) {
            NavUtils.toNamed(Routes.outGoingCallView, arguments: {
              "userJid": [profile.value.jid],
              "callType": CallType.video
            });
          }
        });
    // }
  } else {
    LogMessage.d("askVideoCallPermissions", "false");
  }
  // } else {
  //   toToast(getTranslated("noInternetConnection"));
  // }
}