v0.6.1simple_barcode_scanner
simple_barcode_scanner 可让您在移动设备、网页和 Windows 上扫描条形码和二维码。
217喜欢 9430近 30 天下载150Pub 分数
AndroidiOSWebWindows
简单条形码扫描仪
以下为英文项目原文快照,最新内容请访问 GitHub。
simple_barcode_scanner that let you scan barcode and qr code in mobile,web and windows.
| Android | IOS |
|---|---|
![]() |
![]() |
| Window | Web |
|---|---|
![]() |
![]() |
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.
dart pub publish --dry-run
dart pub publish
依赖清单 8 项
{"sdk":"flutter"}^0.4.0^1.9.1^12.0.1^1.1.1^2.0.32{"sdk":"flutter"}^6.0.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗