remove code for simple barcode scanner
This commit is contained in:
@@ -13,7 +13,6 @@ 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:flutter/material.dart';
|
||||
import 'package:mobile_scanner/mobile_scanner.dart';
|
||||
import 'package:simple_barcode_scanner/simple_barcode_scanner.dart';
|
||||
|
||||
class LoyaltyCards extends StatefulWidget {
|
||||
final AppUser signedInUser;
|
||||
@@ -53,37 +52,37 @@ class _LoyaltyCardsState extends State<LoyaltyCards> {
|
||||
}
|
||||
|
||||
void openscanner() async {
|
||||
if (MzanziInnovationHub.of(context)!.theme.getPlatform() == "Web") {
|
||||
print("================ Web ====================");
|
||||
print("here 1");
|
||||
try {
|
||||
String? res = await SimpleBarcodeScanner.scanBarcode(
|
||||
context,
|
||||
barcodeAppBar: const BarcodeAppBar(
|
||||
appBarTitle: 'Scan Barcode',
|
||||
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;
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
print(error);
|
||||
}
|
||||
} else {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/scanner',
|
||||
arguments: cardNumberController,
|
||||
);
|
||||
}
|
||||
// if (MzanziInnovationHub.of(context)!.theme.getPlatform() == "Web") {
|
||||
// print("================ Web ====================");
|
||||
// print("here 1");
|
||||
// try {
|
||||
// String? res = await SimpleBarcodeScanner.scanBarcode(
|
||||
// context,
|
||||
// barcodeAppBar: const BarcodeAppBar(
|
||||
// appBarTitle: 'Scan Barcode',
|
||||
// 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;
|
||||
// });
|
||||
// }
|
||||
// } catch (error) {
|
||||
// print(error);
|
||||
// }
|
||||
// } else {
|
||||
Navigator.of(context).pushNamed(
|
||||
'/scanner',
|
||||
arguments: cardNumberController,
|
||||
);
|
||||
// }
|
||||
}
|
||||
|
||||
void addCardWindow(BuildContext ctxt) {
|
||||
|
||||
Reference in New Issue
Block a user