搜尋分類、套件與程式碼儲存庫

simple_barcode_scanner 封面
套件詳情v0.6.1

simple_barcode_scanner

simple_barcode_scanner 讓您可以在行動裝置、網頁和 Windows 上掃描條碼和 QR 碼。

AndroidiOSWebWindows
近 30 天下載
1萬
喜歡數
217
Pub 分數
150

安裝套件

flutter pub add simple_barcode_scanner

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個輕量級的 Flutter 套件,可在 Android、iOS、Web 和 Windows 平台上掃描條碼和 QR 碼。它提供了一個簡單的介面,可輕鬆將掃描功能整合到應用程式中,無需複雜設定。以簡潔為設計核心,利用原生相機存取,並支援即時掃描,設定極少。非常適合需要快速且可靠讀取碼字的應用程式。

適用情境

  • 庫存管理
  • 支付處理
  • 票務驗證
  • 使用者身分驗證
  • 產品資訊查詢

主要特色

  • 跨平台支援
  • 簡單 API 結合
  • 即時掃描
  • 輕量級依賴
  • 基於攝影機的檢測

適合對象

  • 行動應用開發者
  • Web 應用程式創建者
  • 桌面應用程式整合商
  • 零售和物流應用
  • 事件票務系統

使用建議

  • 需要行動裝置上的相機權限
  • 有限的自定選項
  • 不支援離線模式
  • 取決於設備攝像頭品質
  • 可能需要平台特定的設定

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

✊ We stand in solidarity with the Tibetan people in their struggle for freedom and cultural preservation. Learn more at Free Tibet.

simple_barcode_scanner

simple_barcode_scanner that let you scan barcode and qr code in mobile,web and windows.

Demo

Android IOS
drawing drawing
Window Web
drawing drawing

Credit

  • This plugin is built upon the flutter_barcode_scanner for Android and iOS. Since the original plugin is no longer actively maintained, I have forked the repository and implemented additional features on top of it. Special thanks to Amol Gangadhare for his work.

Features

  • Scan barcode in mobile devices using flutter_barcode_scanner
  • Scan barcode in web/window using html5-qrcode package

Installation and configuration

Getting started

simple_barcode_scanner: ^0.3.1

Import the library:

import 'package:simple_barcode_scanner/simple_barcode_scanner.dart';

Usage

  1. To scan barcode
   ElevatedButton(
              onPressed: () async {

String? res = await SimpleBarcodeScanner.scanBarcode(
                  context,
                  barcodeAppBar: const BarcodeAppBar(
                    appBarTitle: 'Test',
                    centerTitle: false,
                    enableBackButton: true,
                    backButtonIcon: Icon(Icons.arrow_back_ios),
                  ),
                  isShowFlashIcon: true,
                  delayMillis: 2000,
                  cameraFace: CameraFace.front,
                );
                setState(() {
                  result = res as String;
                });
              },
              child: const Text('Open Scanner'),
            )
  1. To stream barcode
   ElevatedButton(
              onPressed: () async {

                SimpleBarcodeScanner.streamBarcode(
                  context,
                  barcodeAppBar: const BarcodeAppBar(
                    appBarTitle: 'Test',
                    centerTitle: false,
                    enableBackButton: true,
                    backButtonIcon: Icon(Icons.arrow_back_ios),
                  ),
                  isShowFlashIcon: true,
                  delayMillis: 2000,
                ).listen((event) {
                  print("Stream Barcode Result: $event");
                });
              },
              child: const Text('Open Scanner'),
            )
  1. To Scan with widget(Android Only)
   SizedBox(
                width: 200,
                height: 200,
                child: SimpleBarcodeScanner(
                  scaleHeight: 200,
                  scaleWidth: 400,
                  onScanned: (code) {
                    setState(() {
                      result = code;
                    });
                  },
                  continuous: true,
                  onBarcodeViewCreated: (BarcodeViewController controller) {
                    this.controller = controller;
                  },
                )),

Todo

  • Flash and switch camera are only available in mobile devices
  • Enhancement

Note

Feel free to fork and send pull request.

  • iOS support may be delayed as I currently do not have access to an iOS device for testing. Contributions and testing help from the community are welcome!
  • If you have any questions, feedback or ideas,You can create an issue. If you enjoy this project, I'd appreciate your 🌟 on GitHub.

You can also buy me a cup of coffee

publish

dart pub publish --dry-run
dart pub publish

所屬分類

依賴

依賴清單 5 項

原始碼儲存庫

使用此套件的專案