最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

camera is not working in flutter preview is distorted colors only - Stack Overflow

programmeradmin2浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论