搜索插件、代码仓与 APP 分类

插件详情v0.2.0

fast_qr_reader_view

一个支持多码识别的 widget,可在 iOS 和 Android 上提供实时预览。使用原生代码进行检测,可扫描 QR、PDF417 和 CODE39 等多种码。

近 30 天下载
56
喜欢数
51
Pub 分数
40

安装插件

flutter pub add fast_qr_reader_view

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Fast QR Reader View 是一个 Flutter 小部件,使用原生平台代码在 iOS 和 Android 上实现高性能,可实时扫描多种条形码类型,包括二维码、PDF417 和 CODE39。它具有实时预览摄像头画面,确保准确且快速的检测。适用于需要可靠且高效条形码扫描的应用程序,无需完全依赖纯 Dart 实现。

适合场景

  • 移动库存管理
  • 非接触式支付处理
  • PDF417文档扫描
  • 物流中的资产追踪
  • 快速从条形码输入数据

主要特点

  • 原生代码集成以提升速度
  • 支持多种条形码格式
  • 实时摄像头预览
  • 跨平台兼容性
  • 低延迟扫描

适合对象

  • 需要快速条形码扫描的开发人员
  • 需要实时数据捕获的应用程序
  • 现场服务和零售应用
  • 物流和仓储系统

使用建议

  • 需要设备上的相机权限
  • 仅限iOS和Android平台
  • 可能需要额外配置才能访问摄像头
  • 性能取决于设备硬件

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Fast QR Reader View Plugin

See in pub

A Flutter plugin for iOS and Android allowing access to the device cameras to scan multiple type of codes (QR, PDF417, CODE39, etc). Heavily based on camera

Red box is a Flutter animation (removable). Low FPS due to GIF

Features:

  • Display live camera preview in a widget.
  • Uses native AVFoundation code detection in iOS
  • Uses ML Kit in Android

Installation

First, add fast_qr_reader_view as a dependency in your pubspec.yaml file.

iOS

Add a row to the ios/Runner/Info.plist with the key Privacy - Camera Usage Description and a usage description.

Or in text format add the key:

<key>NSCameraUsageDescription</key>
<string>Can I use the camera please?</string>
Android

Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.

minSdkVersion 21
Example

Here is a small example flutter app displaying a full screen camera preview.

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:fast_qr_reader_view/fast_qr_reader_view.dart';

List<CameraDescription> cameras;

Future<Null> main() async {
  cameras = await availableCameras();
  runApp(new CameraApp());
}

class CameraApp extends StatefulWidget {
  @override
  _CameraAppState createState() => new _CameraAppState();
}

class _CameraAppState extends State<CameraApp> {
  QRReaderController controller;

  @override
  void initState() {
    super.initState();
    controller = new QRReaderController(cameras[0], ResolutionPreset.medium, [CodeFormat.qr], (dynamic value){
        print(value); // the result!
    // ... do something
    // wait 3 seconds then start scanning again.
    new Future.delayed(const Duration(seconds: 3), controller.startScanning);
    });
    controller.initialize().then((_) {
      if (!mounted) {
        return;
      }
      setState(() {});
      controller.startScanning();
    });
  }

  @override
  void dispose() {
    controller?.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    if (!controller.value.isInitialized) {
      return new Container();
    }
    return new AspectRatio(
        aspectRatio:
        controller.value.aspectRatio,
        child: new QRReaderPreview(controller));
  }
}

For a more elaborate usage example see here.

Note: This plugin is still under development, and some APIs might not be available yet. Feedback welcome and Pull Requests are most welcome!

所属分类

源码仓库

使用此插件的项目

暂无相关数据。