Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wont detect Barcode #77

Open
DJohnFarley opened this issue Dec 12, 2023 · 2 comments
Open

Wont detect Barcode #77

DJohnFarley opened this issue Dec 12, 2023 · 2 comments

Comments

@DJohnFarley
Copy link

Hey!

I am using flutterflow and have managed to get the button to activate and connect the camera along with an overlay however, It wont focus and detect a barcode. I would like to use this as a barcode & qr code scanner, would you mind looking at the code below and seeing what I might have done wrong. I am fairly new to coding and this is my first project with this language so and simple guidance would be really appreciated.

class CustomButton extends StatefulWidget {
const CustomButton({
Key? key,
this.width,
this.height,
}) : super(key: key);

final double? width;
final double? height;

@OverRide
_CustomButtonState createState() => _CustomButtonState();
}

class _CustomButtonState extends State {
String barcode = 'Tap to scan';

@OverRide
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
ElevatedButton(
child: const Text('Scan Barcode'),
onPressed: () async {
await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => AiBarcodeScanner(
validator: (value) {
return value.startsWith('https://');
},
canPop: false,
onScan: (String value) {
debugPrint(value);
setState(() {
barcode = value;
});
},
onDetect: (p0) {},
onDispose: () {
debugPrint("Barcode scanner disposed!");
},
controller: MobileScannerController(
detectionSpeed: DetectionSpeed.noDuplicates,
),
),
),
);
},
),
Text(barcode),
],
);
}
}

@rvndsngwn
Copy link
Member

Hey @DJohnFarley , thanks for creating an issue. Let me look into this and I'll let you know.

@rvndsngwn
Copy link
Member

Hi @DJohnFarley
The latest version of this package has been released: ai_barcode_scanner: ^3.4.3.
Let me know if you are still facing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants