You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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),
],
);
}
}
The text was updated successfully, but these errors were encountered: