showVideoSwitchPopup method
Future<void>
showVideoSwitchPopup(
)
Implementation
Future<void> showVideoSwitchPopup() async {
if (await AppPermission.askVideoCallPermissions(context)) {
showingVideoSwitchPopup = true;
if (!context.mounted) return;
Helper.showAlert(
message: Constants.videoSwitchMessage,
actions: [
TextButton(
onPressed: () {
outGoingRequest = false;
showingVideoSwitchPopup = false;
closeDialog();
},
child: const Text("CANCEL",
style: TextStyle(color: buttonBgColor))),
TextButton(
onPressed: () {
if (callType.value == CallType.audio &&
isOneToOneCall &&
MirrorflyUikit.instance.navigationManager
.getCurrentRoute() ==
Constants.onGoingCallView) {
outGoingRequest = true;
Mirrorfly.requestVideoCallSwitch().then((value) {
if (value) {
showingVideoSwitchPopup = false;
closeDialog();
showWaitingPopup();
}
});
} else {
closeDialog();
}
},
child: const Text("SWITCH",
style: TextStyle(color: buttonBgColor)))
],
barrierDismissible: false,
context: context);
} else {
toToast("Camera Permission Needed to switch the call");
}
}