0

I have a simple widget:

class TestGoogleMap extends StatelessWidget {
  const TestGoogleMap({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Test Google Map'),
      ),
      body: GoogleMap(
        onTap: (LatLng ll) {
          print('tapped Google Map');
        },
        initialCameraPosition: CameraPosition(target: LatLng(1.0, 1.0)),
      ),
    );
  }
}

When I tap the map, there is no output. What could be the issue?

Edit: I added a longPress function, and it seems that whenever I tap the map, the longPress function is triggered instead.

Joel Castro
  • 485
  • 6
  • 20

1 Answers1

0

I think you miss this link in your googleMap

gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>[
           new Factory<OneSequenceGestureRecognizer>(() => new EagerGestureRecognizer(),),
          ].toSet(),
benten
  • 696
  • 7
  • 18