action_change_camera method

Future<void> action_change_camera({
  1. required int cameraId,
  2. required void setState(
    1. void callback()
    ),
  3. required bool mounted(),
  4. required void onCameraNotInit(),
  5. required void onCameraNotSelect(),
  6. required void onCameraNotActive(),
})

Implementation

Future<void> action_change_camera({
  required int cameraId,
  required void Function(void Function() callback) setState,
  required bool Function() mounted,
  required void Function() onCameraNotInit,
  required void Function() onCameraNotSelect,
  required void Function() onCameraNotActive,
}) async {
  bool is_check_camera = util_check_camera(
    onCameraNotInit: onCameraNotInit,
    onCameraNotSelect: onCameraNotSelect,
    onCameraNotActive: onCameraNotActive,
  );
  if (!is_check_camera) {
    return;
  }
  camera_id = cameraId;
  if (isMobile) {
    await initializeCameraById(
      camera_id: camera_id,
      setState: setState,
      mounted: mounted,
    );
  } else if (isDesktop) {
    if (Platform.isWindows) {
      await dispose();

      await initializeCameraById(
        camera_id: camera_id,
        setState: setState,
        mounted: mounted,
      );
    }
  }
  return;
}