Search packages, repositories and app categories

Package detailsv1.0.4

qrcode

A flutter plugin for scanning QR codes. Use AVCaptureSession in iOS and zxing in Android.

30-day downloads
40
Likes
37
Pub points
40

Install package

flutter pub add qrcode

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The qrcode package is a Flutter plugin designed for scanning QR codes across iOS and Android platforms. On iOS, it leverages AVCaptureSession for efficient barcode detection, while on Android, it uses the ZXing library to ensure reliable scanning performance. This lightweight solution enables developers to integrate QR code scanning functionality into their apps with minimal setup. It supports real-time scanning and provides straightforward access to decoded data, making it ideal for applications requiring quick data retrieval from QR codes.

Use cases

  • Mobile payment systems
  • Event ticket validation
  • Product information lookup
  • Contactless data sharing
  • Inventory management

Key features

  • Cross-platform QR scanning
  • iOS with AVCaptureSession
  • Android with ZXing
  • Real-time scanning
  • Simple API integration

Suitable for

  • Apps needing QR code reading
  • Developers building inventory tools
  • Startups creating contactless solutions
  • E-commerce and retail apps
  • Event and ticketing platforms

Considerations

  • Requires camera permissions on both platforms
  • Limited to QR code scanning (not generation)
  • May need additional UI for camera preview
  • Performance depends on device camera quality
  • No support for barcodes beyond QR codes

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

qrcode

A flutter plugin for scanning QR codes. Use AVCaptureSession in iOS and zxing in Android.

Usage

Use this package as a library
Add dependency

Add this to your package's pubspec.yaml file:

dependencies:
  qrcode: ^1.0.5
Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get
Import it

Now in your Dart code, you can use:

import 'package:qrcode/qrcode.dart';
Basic
class _MyAppState extends State<MyApp> {
  QRCaptureController _captureController = QRCaptureController();

  bool _isTorchOn = false;

  @override
  void initState() {
    super.initState();

    _captureController.onCapture((data) {
      print('onCapture----$data');
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Stack(
          alignment: Alignment.center,
          children: <Widget>[
            QRCaptureView(controller: _captureController),
            Align(
              alignment: Alignment.bottomCenter,
              child: _buildToolBar(),
            )
          ],
        ),
      ),
    );
  }

  Widget _buildToolBar() {
    return Row(
          mainAxisSize: MainAxisSize.max,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            FlatButton(
              onPressed: () {
                _captureController.pause();
              },
              child: Text('pause'),
            ),
            FlatButton(
              onPressed: () {
                if (_isTorchOn) {
                  _captureController.torchMode = CaptureTorchMode.off;
                } else {
                  _captureController.torchMode = CaptureTorchMode.on;
                }
                _isTorchOn = !_isTorchOn;
              },
              child: Text('torch'),
            ),
            FlatButton(
              onPressed: () {
                _captureController.resume();
              },
              child: Text('resume'),
            ),
          ],
        );
  }
}

Integration

iOS

To use on iOS, you must add the following to your Info.plist

<key>NSCameraUsageDescription</key>
<string>Camera permission is required for qrcode scanning.</string>
<key>io.flutter.embedded_views_preview</key>
<true/>

Categories

Source repository

Projects using this package

No data available yet.