smart_barcode_reader 0.0.1+2 copy "smart_barcode_reader: ^0.0.1+2" to clipboard
smart_barcode_reader: ^0.0.1+2 copied to clipboard

A Flutter package for intelligently detecting and processing barcode scanner inputs, supporting formats like EAN-13 with adaptive speed and length validation.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:smart_barcode_reader/smart_barcode_reader.dart';

void main() {
  runApp(const SmartBarcodeReaderExample());
}

class SmartBarcodeReaderExample extends StatelessWidget {
  const SmartBarcodeReaderExample({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Smart Barcode Reader Demo')),
        body: SmartBarCodeReaderWidget(
          options: SmartBarCodeReaderOptions(
            onBarcodeDetected: (barcode) {
              debugPrint('Scanned barcode: $barcode');
              ScaffoldMessenger.of(context).showSnackBar(
                SnackBar(content: Text('Barcode: $barcode')),
              );
            },
            minLength: 6,
            maxLength: 13,
            maxInterKeyDurationMs: 30,
            tolerance: 2.5,
          ),
          child: const Center(
            child: Text(
              'Scan a barcode',
              style: TextStyle(fontSize: 20),
            ),
          ),
        ),
      ),
    );
  }
}
1
likes
150
points
6
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for intelligently detecting and processing barcode scanner inputs, supporting formats like EAN-13 with adaptive speed and length validation.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on smart_barcode_reader