qrbar 0.0.3
qrbar: ^0.0.3 copied to clipboard
A lightweight Flutter package to scan and generate QR codes and barcodes with a clean and unified API.
๐ฆ qrbar #
qrbar is a lightweight Flutter package for scanning and generating QR codes and barcodes.
It wraps common functionality into a clean, unified API โ making it easy to integrate with any Flutter app.
โจ Features #
- ๐ท Scan QR codes and various barcodes using the device camera
- ๐งพ Generate QR codes or barcodes as Flutter widgets
- ๐จ Customizable output: size, foreground/background color
- ๐ Clean and minimal API with no third-party exposure
- ๐ Supports multiple formats including
QR,Code128,EAN13,UPC,PDF417,Aztec,DataMatrix
โ Platform Support #
| Platform | Generate | Scan |
|---|---|---|
| Android | โ | โ |
| iOS | โ | โ |
| Web | โ (QR only) | โ |
| Windows | โ (QR only) | โ |
| macOS | โ (QR only) | โ |
| Linux | โ (QR only) | โ |
โ ๏ธ Camera-based scanning is only supported on Android and iOS.
๐ Installation #
Add the dependency to your pubspec.yaml:
dependencies:
qrbar: ^0.0.1
Then run:
flutter pub get
โ๏ธ Platform Setup (for Scanning) #
Android #
In android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA" />
<application>
...
</application>
iOS #
In ios/Runner/Info.plist:
<key>NSCameraUsageDescription</key>
<string>Camera access is required for scanning QR and barcodes.</string>
๐ก Quick Usage #
Generate a QR Code #
import 'package:qrbar/qrbar.dart';
QrBarGenView(
data: 'https://example.com',
type: QrBarType.qr,
size: 200,
);
Generate a Barcode #
QrBarGenView(
data: '1234567890',
type: QrBarType.c128,
size: 200,
);
Scan a QR or Barcode #
QrBarScanView(
onScan: (QrBarScanResult result) {
print('Scanned: ${result.value} (${result.type.label})');
},
);
๐งฑ API Reference #
Code Type #
enum QrBarType {
qr, c128, ean13, upc, pdf417, aztec, dm
}
Generator Config #
class QrBarGenOpts {
final String data;
final QrBarType type;
final double size;
final Color bg;
final Color fg;
}
Scan Result #
class QrBarScanResult {
final String value;
final QrBarType type;
final DateTime time;
}
๐ License #
MIT License ยฉ 2025 Sovanken