패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.1.1

camerakit

Flutter 카메라 키트는 사진 촬영 및 바코드 스캔에 네이티브 Android 및 iOS API를 사용하며 조절 가능한 플래시를 지원합니다.

AndroidiOS
30일 다운로드
208
좋아요
33
Pub 점수
125

패키지 설치

flutter pub add camerakit

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

CameraKit는 고성능 이미지 캡처 및 바코드 스캔을 가능하게 하는 플러터 플러그인으로, 네이티브 Android 및 iOS 카메라 API를 활용합니다. 개발자에게 최적의 조명 조건을 위해 조절 가능한 플래시 설정을 포함한 카메라 기능에 대한 세밀한 제어를 제공합니다. 최소한의 구성으로 두 플랫폼 모두에서 원활하게 통합될 수 있도록 설계되었습니다. 문서 스캔, QR 코드 리더, 사진 캡처 도구와 같은 신뢰할 수 있는 카메라 기능이 필요한 애플리케이션에 적합합니다.

사용 사례

  • 소매 앱에서의 바코드 스캔
  • 디지털 양식을 위한 문서 캡처
  • 모바일 재고 시스템에서의 사진 캡처
  • QR 코드 생성 및 읽기
  • 실시간 이미지 처리 워크플로우

주요 기능

  • 안드로이드 및 iOS에서의 네이티브 카메라 접근
  • 더 나은 조명을 위한 플래시 제어
  • 바코드 및 QR 코드 스캔
  • 고해상도 이미지 캡처
  • 크로스 플랫폼 호환성

적합한 대상

  • 카메라 통합이 필요한 모바일 앱
  • 바코드 스캔이 필요한 앱
  • 재고 또는 문서 도구를 개발하는 개발자
  • 실시간 카메라 피드를 사용하는 프로젝트
  • Android 및 iOS를 대상으로 하는 Flutter 앱

고려 사항

  • 앱 매니페스트에서 카메라 권한이 필요합니다
  • 바코드 스캔을 위해 추가 설정이 필요할 수 있습니다
  • 카메라 전용 작업에 한정
  • 완전한 기능을 위해 네이티브 SDK에 의존합니다
  • 비디오 녹화 또는 고급 카메라 효과에 적합하지 않습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Use Prerelease version to support nullsafety.

Flutter Camera Kit

Flutter camera kit uses native android and ios APIs for taking picture and scanning barcode with controlable flash.This plugin uses Camera2 API in android and AVFoundation in iOS for taking picture and MLFirebase library for scanning barcode.

Main features:

  • Easy implementation with controller
  • Automatic permission handling (no need for 3rd-party libraries)
  • Automatic camera resource handling for battery usage and avoid any conflict with another camera based applications.(you can also manage manually pause and resume camera)
  • fill and fit mode for camera preview frame.
  • Optimize memory usage in taking picture
  • auto, on and off flash mode while taking picture and scan barcode.

Installation

iOS

Add io.flutter.embedded_views_preview in info.plist with value YES. Add Privacy - Camera Usage Description in info.plist.

Usage

For use plugin, You shoude an instance of CameraKitController then initial CameraKitView passing CameraKitController instance to it.

   cameraKitController = CameraKitController();
    cameraKitView = CameraKitView(
      cameraKitController: cameraKitController,
      hasBarcodeReader: true,
      barcodeFormat: BarcodeFormats.FORMAT_ALL_FORMATS
      scaleType: ScaleTypeMode.fill,
      previewFlashMode: CameraFlashMode.auto,
      androidCameraMode: AndroidCameraMode.API_X,
      cameraSelector: CameraSelector.back
      onPermissionDenied: () {
          print("Camera permission is denied.");
          //ToDo on permission denied by user
      },
      onBarcodeRead: (code) {
        print("Barcode is read: " + code);
        //ToDo on barcode read
      },
    );

Cunstructor parameters

hasBarcodeReader: True means scan barcode mode and false means take picture mode

barcodeFormat: Set barcode format from available values, default value is FORMAT_ALL_FORMATS.

scaleType: There are 2 modes ScaleTypeMode.fill and ScaleTypeMode.fit for this parameter. If you want camera preview fill your widget area, use fill mode. In this mode, camera preview may be croped for filling widget area. If you want camera preview to show entire lens preview, use fit mode. In this mode, camera preview may be shows blank areas.

previewFlashMode: This parameter accepts 3 values, CameraFlashMode.auto, CameraFlashMode.on and CameraFlashMode.off. For changing value after initial use changeFlashMode method in controller.

androidCameraMode: This parameter has been replaced with useCamera2API. This parameter accepts 3 values, API_X, API_1, API_2. Default value is API_X. Some feature is available in each value. API_1 features: Taking picture API_2 features: Taking picture, Scaning barcode (Taking picture with flash has some issues, Auto flash in barcode scanning mode works in some phones.) API_X features: Taking picture, Scaning barcode (Auto flash in barcode scanning mode doesn't work.)

cameraSelector: Set front and back camera with this parameter. This parameter accepts 3 values, back and front

onPermissionDenied: After android and iOS user deny run time permission, this method is called.

onBarcodeRead: In barcodeReader mode, while camera preview detect barcodes, This method is called.

Controller methods

Take Picture You can take picture with this method. Unlike API_2, in API_X, you can take picture in scaning barcode mode. You can pass your custom path for save image. You can pass nothing and the image will be saved in default path.

  String path = await cameraKitController.takePicture({Your custom path});

Change Flash Mode For changing flash mode, don't change cunstructor parameter. Use changeFlashMode method in controller. Pass CameraFlashMode enum to this method.

    cameraKitController.changeFlashMode(CameraFlashMode.on);

Pause and Resume camera This plugin automatically manage pause and resume camera based on android, iOS life cycle and widget visibility, also you can call with your controller when ever you need.

    cameraKitController.pauseCamera();
    cameraKitController.resumeCamera();

카테고리

의존성

의존성 목록 1 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.