scanner fix

This commit is contained in:
2024-11-25 16:14:05 +02:00
parent 8be14e61ea
commit 3afec7ca1c
2 changed files with 72 additions and 11 deletions

View File

@@ -104,17 +104,25 @@ class _LoyaltyCardsState extends State<LoyaltyCards> {
),
const SizedBox(width: 10),
MIHButton(
onTap: () {
_qrBarCodeScannerDialogPlugin.getPlatformVersion().then((v) {
print(v);
});
_qrBarCodeScannerDialogPlugin.getScannedQrBarCode(
context: context,
onCode: (code) {
setState(() {
this.code = code;
});
});
onTap: () 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: 500,
cameraFace: CameraFace.back,
scanFormat: ScanFormat.ONLY_BARCODE,
);
if (res != null) {
setState(() {
cardNumberController.text = res;
});
}
},
buttonText: "Scan",
buttonColor: