action_change_camera method
Future<void>
action_change_camera(
{ - required int cameraId,
- required void setState(
- void callback()
),
- required bool mounted(),
- required void onCameraNotInit(),
- required void onCameraNotSelect(),
- 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;
}