switchCameraByType method

Future<bool> switchCameraByType(
  1. RCRTCCameraCaptureCameraType type
)

Implementation

Future<bool> switchCameraByType(RCRTCCameraCaptureCameraType type) async {
  if (type == RCRTCCameraCaptureCameraType.Front && !_isFrontCamera) {
    _isFrontCamera = await channel.invokeMethod("switchCamera");
  } else if (type == RCRTCCameraCaptureCameraType.Back && _isFrontCamera) {
    _isFrontCamera = await channel.invokeMethod("switchCamera");
  }
  return _isFrontCamera;
}