makeVideoCall method

void makeVideoCall(
  1. String? fromUser
)

Implementation

void makeVideoCall(String? fromUser) async {
  if (!availableFeatures.value.isOneToOneCallAvailable.checkNull()) {
    DialogUtils.showFeatureUnavailable();
    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: fromUser.checkNull(),
            flyCallBack: (FlyResponse response) {
              if (response.isSuccess) {
                //setOnGoingUserGone();
                NavUtils.toNamed(Routes.outGoingCallView, arguments: {
                  "userJid": [fromUser],
                  "callType": CallType.video
                })?.then((value) => setOnGoingUserAvail());
              }
            });
      }
    } else {
      LogMessage.d("askVideoCallPermissions", "false");
    }
  } else {
    toToast(getTranslated("noInternetConnection"));
  }
}