makeVideoCall method

void makeVideoCall()

Implementation

void makeVideoCall() async {
  closeKeyBoard();
  if (await AppUtils.isNetConnected()) {
    if(context.mounted) {
      if (Platform.isAndroid
          ? await AppPermission.askVideoCallPermissions(context)
          : await AppPermission.askiOSVideoCallPermissions(context)) {
        Mirrorfly.makeVideoCall(profile.jid.checkNull()).then((value) {
          if (value) {
            setOnGoingUserGone();
            /*Navigator.push(
              context,
              MaterialPageRoute(
                builder: (context) => OutGoingCallView(userJid: profile.jid!),
              ),
            ).then((value) => setOnGoingUserAvail());*/
            MirrorflyUikit.instance.navigationManager.navigateTo(context: context,
                pageToNavigate: OutGoingCallView(userJid: profile.jid!), routeName: 'outgoing_call_view',
                onNavigateComplete: (){
                  setOnGoingUserAvail();
                });
          }
        }).catchError((e) {
          debugPrint("#Mirrorfly Call $e");
        });
      } else {
        LogMessage.d("askVideoCallPermissions", "false");
      }
    }
  } else {
    toToast(Constants.noInternetConnection);
  }
}