v0.6.0simple_barcode_scanner
simple_barcode_scanner 讓您可以在行動裝置、網頁和 Windows 上掃描條碼和 QR 碼。
218喜歡 7120近 30 天下載130Pub 分數
AndroidiOSWebWindows
簡單條碼掃描器
{"sdk":"flutter"}^0.4.0^1.9.1^12.0.1^1.1.1^2.0.32{"sdk":"flutter"}^6.0.0以下為英文專案原文快照,最新內容請造訪 GitHub。
simple_barcode_scanner that let you scan barcode and qr code in mobile,web and windows.
| Android | IOS |
|---|---|
| drawing | drawing |
| Window | Web |
|---|---|
| drawing | drawing |
simple_barcode_scanner: ^0.3.1
Import the library:
import 'package:simple_barcode_scanner/simple_barcode_scanner.dart';
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'),
)
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'),
)
SizedBox(
width: 200,
height: 200,
child: SimpleBarcodeScanner(
scaleHeight: 200,
scaleWidth: 400,
onScanned: (code) {
setState(() {
result = code;
});
},
continuous: true,
onBarcodeViewCreated: (BarcodeViewController controller) {
this.controller = controller;
},
)),
Feel free to fork and send pull request.
https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png
dart pub publish --dry-run
dart pub publish