the sample code
cameras = await availableCameras();
final frontCamera = cameras!.firstWhere(
(camera) => camera.lensDirection == CameraLensDirection.front,
orElse: () => cameras!.first, // Fallback
);
_controller = CameraController(
frontCamera,
ResolutionPreset.medium, // Try medium resolution first
);
for preview sample code
return AspectRatio(
aspectRatio: _controller!.value.aspectRatio, // Keep correct ratio
child: CameraPreview(_controller!),
);
result:result even does not seems logical its something keeps fluctuating no actual data shows over here even if the camera is covered the result is same
screenshot
Android 14,pixel 7 pro api 34 | android studio | ndk v28