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

qr_code_scanner_plus 표지
패키지 상세v2.3.2

qr_code_scanner_plus

Flutter 내부에 삽입할 수 있는 QR 코드 스캐너입니다. 안드로이드에서는 zxing을, iOS에서는 AVFoundation을 사용합니다.

AndroidiOSWeb
30일 다운로드
8.7만
좋아요
131
Pub 점수
160

패키지 설치

flutter pub add qr_code_scanner_plus

패키지 개요

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

안드로이드의 zxing과 iOS의 AVFoundation을 활용하여 앱에 QR 코드 스캔 기능을 통합하는 플러터 패키지입니다. 안드로이드, iOS, 웹 플랫폼에서 실시간 스캔을 지원하며 원활한 통합을 제공합니다. 복잡한 설정 없이 신뢰성 있고 성능이 뛰어난 QR 스캔을 원하는 개발자를 위한 것입니다. 이 패키지는 vespr.xyz에서 유지보수되며 pub.dev를 통해 이용할 수 있습니다.

사용 사례

  • 앱 내에서 결제를 위한 QR 코드 스캔
  • QR 코드를 통한 사용자 인증
  • 제품 정보 검색
  • 이벤트 티켓 검증
  • 장치 간 데이터 공유
  • 재고 관리

주요 기능

  • Android 및 iOS에서의 네이티브 성능
  • 크로스 플랫폼 지원 (Android, iOS, Web)
  • Flutter 위젯과의 간단한 통합
  • 실시간 스캔 기능
  • 가볍고 효율적
  • 오픈소스이며 공개 저장소

적합한 대상

  • 모바일 앱 개발자
  • 결제 및 핀테크 애플리케이션
  • 이벤트 및 티켓팅 플랫폼
  • 소매 및 재고 시스템
  • 안전한 데이터 교환을 필요로 하는 앱

고려 사항

  • 웹 지원은 카메라 접근이 제한될 수 있습니다
  • 모바일에서 카메라 권한이 필요합니다
  • 성능은 기기 하드웨어에 따라 달라집니다
  • 웹 배포를 위해 추가 구성이 필요할 수 있습니다
  • 스캔 인터페이스의 사용자 정의가 제한적

원본 README

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

pub package

⚠️ If you are starting a new project, or your project requires new features or long-term stability, use an actively maintained alternative such as mobile_scanner.


⚠️ Maintenance-only fork (no new features)

This package is a maintenance-only fork of the original qr_code_scanner package.

Its sole purpose is to keep existing projects compiling and running on newer versions of Flutter, the Android Gradle Plugin, and related tooling after the upstream package became unmaintained. It exists to allow existing users to postpone migration, not to provide an actively developed QR scanning solution.

New feature PRs will be rejected.
This includes (but is not limited to):

  • New functionality
  • Feature extensions
  • API changes or expansions
  • Behavior changes beyond minimal fixes required for compatibility

If you need additional functionality, this package is not the right choice.


Scope and limitations

  • I maintain only the Flutter-facing code in this repository.
  • The underlying native scanning is handled by:
    • Android: zxing
    • iOS: Native AVFoundation (Swift Package Manager and CocoaPods supported)

The original qr_code_scanner package used MTBBarcodeScanner on iOS, which has been archived and unmaintained since 2021. This fork replaced it with a native AVFoundation implementation to enable Swift Package Manager support and remove the only third-party iOS dependency.

The Android native library (zxing) is outdated and unmaintained. There are known issues and limitations in that native package that will not be fixed here.

As a result:

  • Native-level bugs should be expected.
  • This package is not a good foundation for adding or extending features.
  • Only minimal fixes required to keep the package usable on current Flutter toolchains will be considered.

Projects that require new functionality, reliability, or long-term maintenance of both Flutter and native code should migrate to a fully maintained alternative such as mobile_scanner.


QR Code Scanner Plus

A QR code scanner for iOS, Android, and Web that embeds platform views in Flutter.

This description is retained for historical context only and does not imply ongoing feature development.


Screenshots

Android

iOS

Get Scanned QR Code

When a QR code is recognized, the text identified will be set in 'result' of type Barcode, which contains the output text as property 'code' of type String and scanned code type as property 'format' which is an enum BarcodeFormat, defined in the library.

class _QRViewExampleState extends State<QRViewExample> {
  final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
  Barcode? result;
  QRViewController? controller;

  // In order to get hot reload to work we need to pause the camera if the platform
  // is android, or resume the camera if the platform is iOS.
  @override
  void reassemble() {
    super.reassemble();
    if (Platform.isAndroid) {
      controller!.pauseCamera();
    } else if (Platform.isIOS) {
      controller!.resumeCamera();
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: <Widget>[
          Expanded(
            flex: 5,
            child: QRView(
              key: qrKey,
              onQRViewCreated: _onQRViewCreated,
            ),
          ),
          Expanded(
            flex: 1,
            child: Center(
              child: (result != null)
                  ? Text(
                      'Barcode Type: ${describeEnum(result!.format)}   Data: ${result!.code}')
                  : Text('Scan a code'),
            ),
          )
        ],
      ),
    );
  }

  void _onQRViewCreated(QRViewController controller) {
    this.controller = controller;
    controller.scannedDataStream.listen((scanData) {
      setState(() {
        result = scanData;
      });
    });
  }
}

Android Integration

In order to use this plugin, please make sure to add the Camera permissions in android/app/src/main/AndroidManifest.xml

    <uses-permission android:name="android.permission.CAMERA" />

iOS Integration

In order to use this plugin, add the following to your Info.plist file:

<key>NSCameraUsageDescription</key>
<string>This app needs camera access to scan QR codes</string>
UIScene lifecycle

The iOS plugin supports both the UIScene lifecycle and the legacy application lifecycle. No plugin-specific SceneDelegate or camera lifecycle changes are required.

The host app must still adopt UIScene; updating this package alone does not migrate your app. Follow Flutter's UIScene migration guide to configure UIApplicationSceneManifest in Info.plist and register plugins in didInitializeImplicitFlutterEngine using engineBridge.pluginRegistry. The example AppDelegate and example Info.plist already use this setup.

Web Integration

Add this to web/index.html:

<script src="https://cdn.jsdelivr.net/npm/jsqr@1.3.1/dist/jsQR.min.js"></script>

Please note: on web, only QR codes are supported. Other barcodes and 2D codes cannot be scanned.

Web support is in very early stage. Features such as flash, pause or resume are not implemented. Moreover, the camera preview does not respect the surrounding constraints. This is not at last due to Flutter's early state of platform views on web.

Flip Camera (Back/Front)

The default camera is the back camera.

await controller.flipCamera();

Flash (Off/On)

By default, flash is OFF.

await controller.toggleFlash();

Resume/Pause

Pause camera stream and scanner.

await controller.pauseCamera();

Resume camera stream and scanner.

await controller.resumeCamera();

Credits

  • Android: https://github.com/zxing/zxing
  • Original qr_code_scanner contributors

카테고리

의존성

의존성 목록 1 개

소스 저장소

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