Search categories, packages and repositories

simple_barcode_scanner cover
Package detailsv0.6.1

simple_barcode_scanner

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

AndroidiOSWebWindows
30-day downloads
10K
Likes
217
Pub points
150

Install package

flutter pub add simple_barcode_scanner

Package Overview

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

A lightweight Flutter package for scanning barcodes and QR codes across Android, iOS, Web, and Windows platforms. It provides a straightforward interface to integrate scanning functionality into apps without complex setup. Built with simplicity in mind, it leverages native camera access and supports real-time scanning with minimal configuration. Ideal for applications requiring quick and reliable code reading.

Use cases

  • Inventory management
  • Payment processing
  • Ticket validation
  • User authentication
  • Product information lookup

Key features

  • Cross-platform support
  • Simple API integration
  • Real-time scanning
  • Lightweight dependency
  • Camera-based detection

Suitable for

  • Mobile app developers
  • Web application creators
  • Desktop app integrators
  • Retail and logistics apps
  • Event ticketing systems

Considerations

  • Requires camera permissions on mobile
  • Limited customization options
  • No offline mode support
  • Depends on device camera quality
  • May need platform-specific configuration

Original README

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

✊ 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

Categories

Dependencies

Dependency list 5 items

Source repository

Projects using this package