initializeCamera method
Future<void>
initializeCamera(
{ - required void setState(
- void callback()
),
})
Implementation
Future<void> initializeCamera({
required void Function(void Function() callback) setState,
}) async {
if (!is_camera_init) {
return;
}
if (isMobile) {
camera_mobile_controller = camera_package.CameraController(
camera_mobile_datas.first,
camera_package.ResolutionPreset.max,
);
is_select_camera = true;
camera_id = camera_mobile_controller.cameraId;
}
if (isDesktop) {
if (Platform.isWindows) {
camera_id = await camera_windows.createCamera(
camera_mobile_datas.first, camera_package.ResolutionPreset.max);
is_select_camera = true;
setState(() {});
}
}
return;
}