lockUnlockCaptureOrientation method

void lockUnlockCaptureOrientation()

Implementation

void lockUnlockCaptureOrientation() async {
  if (!initialized) {
    _uiHandler.showSnackBar('Couldn\'t find the camera!');
    return;
  }

  if (controller.value.isCaptureOrientationLocked) {
    await controller.unlockCaptureOrientation();
    _uiHandler.showSnackBar('Capture orientation unlocked');
  } else {
    await controller.lockCaptureOrientation();
    _uiHandler.showSnackBar(
      '''Capture orientation locked to ${controller.value.lockedCaptureOrientation.toString().split('.').last}''',
    );
  }
}