Closed christianarduino closed 4 years ago
This must be something else in your app, there are no reasons for it to not work.
I've made several attempts and I don't think it's related to my code
I tried to recreate the error in a simple page with Scaffold widget and the error persists
My code:
import 'package:barcode_widget/barcode_widget.dart';
import 'package:flutter/material.dart';
class Test extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: Center(
child: FittedBox(
child: GestureDetector(
child: BarcodeWidget(
data: "7482734KINDJKF",
barcode: Barcode.code39(),
),
onTap: () {
print("test");
},
),
),
),
),
);
}
}
This time I tried on an iPhone 11 Pro Max simulator
if you wrap the barcode widget with Material() it works.
I confirm that using the Material() widget, gestures are detected
Fixed in barcode_widget-1.2.2. No need for Material() anymore. Don't hesitate to Buy Me A Coffee.
Using the onTap method of the GestureDetector widget, the gesture is not detected
How I use it:
Device: LG G6 Android 8.0
Computer: Macbook air 2018