Merge pull request #11 from yaso-meth/mzansi-wallet-scanner-fix
Mzansi-wallet-scanner-fix
This commit is contained in:
@@ -12,6 +12,7 @@ import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_wallet/builder/build_l
|
|||||||
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_wallet/components/mih_card_display.dart';
|
import 'package:Mzansi_Innovation_Hub/mih_packages/mzansi_wallet/components/mih_card_display.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile_scanner/mobile_scanner.dart';
|
import 'package:mobile_scanner/mobile_scanner.dart';
|
||||||
|
import 'package:simple_barcode_scanner/simple_barcode_scanner.dart';
|
||||||
// import 'package:simple_barcode_scanner/simple_barcode_scanner.dart';
|
// import 'package:simple_barcode_scanner/simple_barcode_scanner.dart';
|
||||||
|
|
||||||
class LoyaltyCards extends StatefulWidget {
|
class LoyaltyCards extends StatefulWidget {
|
||||||
@@ -53,13 +54,12 @@ class _LoyaltyCardsState extends State<LoyaltyCards> {
|
|||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
windowTitle: "Scanner",
|
windowTitle: "Scanner",
|
||||||
windowBody: [
|
windowBody: [
|
||||||
SizedBox(
|
Expanded(
|
||||||
height: 1000,
|
|
||||||
child: MobileScanner(
|
child: MobileScanner(
|
||||||
controller: scannerController,
|
controller: scannerController,
|
||||||
onDetect: foundCode,
|
onDetect: foundCode,
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
windowTools: [],
|
windowTools: [],
|
||||||
onWindowTapClose: () {
|
onWindowTapClose: () {
|
||||||
@@ -142,29 +142,31 @@ class _LoyaltyCardsState extends State<LoyaltyCards> {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
MIHButton(
|
MIHButton(
|
||||||
onTap: () {
|
onTap:
|
||||||
openscanner();
|
// () {
|
||||||
|
// openscanner();
|
||||||
|
// },
|
||||||
|
() async {
|
||||||
|
print("here");
|
||||||
|
String? res = await SimpleBarcodeScanner.scanBarcode(
|
||||||
|
context,
|
||||||
|
barcodeAppBar: const BarcodeAppBar(
|
||||||
|
appBarTitle: 'Scan Bardcode',
|
||||||
|
centerTitle: true,
|
||||||
|
enableBackButton: true,
|
||||||
|
backButtonIcon: Icon(Icons.arrow_back),
|
||||||
|
),
|
||||||
|
isShowFlashIcon: true,
|
||||||
|
delayMillis: 500,
|
||||||
|
cameraFace: CameraFace.back,
|
||||||
|
scanFormat: ScanFormat.ONLY_BARCODE,
|
||||||
|
);
|
||||||
|
if (res != null) {
|
||||||
|
setState(() {
|
||||||
|
cardNumberController.text = res;
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// () async {
|
|
||||||
// String? res = await SimpleBarcodeScanner.scanBarcode(
|
|
||||||
// context,
|
|
||||||
// barcodeAppBar: const BarcodeAppBar(
|
|
||||||
// appBarTitle: 'Scan Bardcode',
|
|
||||||
// centerTitle: true,
|
|
||||||
// enableBackButton: true,
|
|
||||||
// backButtonIcon: Icon(Icons.arrow_back),
|
|
||||||
// ),
|
|
||||||
// isShowFlashIcon: true,
|
|
||||||
// delayMillis: 500,
|
|
||||||
// cameraFace: CameraFace.back,
|
|
||||||
// scanFormat: ScanFormat.ONLY_BARCODE,
|
|
||||||
// );
|
|
||||||
// if (res != null) {
|
|
||||||
// setState(() {
|
|
||||||
// cardNumberController.text = res;
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
buttonText: "Scan",
|
buttonText: "Scan",
|
||||||
buttonColor:
|
buttonColor:
|
||||||
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
|||||||
Reference in New Issue
Block a user