switchCamera function

Future<void> switchCamera({
  1. required SessionController sessionController,
})

Function to switch between front and rear camera

Implementation

Future<void> switchCamera(
    {required SessionController sessionController}) async {
  var status = await Permission.camera.status;
  if (status.isDenied) {
    await Permission.camera.request();
  }
  await sessionController.value.engine?.switchCamera();
}