Open hs-dev1 opened 2 years ago
same here. @mhussnainshabbir did you solved this issue
This worked in my case...
final _qrBarCodeScannerDialogPlugin = QrBarCodeScannerDialog();
String? scanQRCode(context) {
String? result;
Future.delayed(const Duration(milliseconds: 1), () async {
_qrBarCodeScannerDialogPlugin.getScannedQrBarCode(
context: context,
onCode: (code) async {
if (code == null) {
return null;
}
if (kIsWeb) {
result = code.substring(15);
} else {
result = code;
}
return result;
});
});
return null;
}
CC: @hs-dev1 @Raviteja11122
_qrBarCodeScannerDialogPlugin.getScannedQrBarCode(); it is working fine on large screens, but when I open it on small screens and mobile, it works on long Press to open dialog rather than on tap.
My on Tap function:
onTap: () { _qrBarCodeScannerDialogPlugin.getScannedQrBarCode( context: context, onCode: (code) { setState(() { this.qrCode = code!; }); if (qrCode != '') { showDialog( context: context, builder: (context) { return Container( color: R.colors.white, child: AppLoader(), ); }) .then((value) => context.go('/homeView/menuView')); } }); },