0

Use case

hey everybody. my problem is calling callback only when a user drags the map in some direction and not when he taps on the marker. I was trying to add the solution described here.

gestureRecognizers: Set()
            ..add(Factory<DragGestureRecognizer>(() => Test(() {
                myCallBack();
            })),

but in this case, there is not any chance to separate gestures. My next effort was adding certain GestureRecognazers and assign myCallBack on onStart, onDown etc.

 GoogleMap(
      gestureRecognizers: Set()
        ..add(Factory<PanGestureRecognizer>(() => PanGestureRecognizer()..onUpadate = () {myCallback()}))
        ..add(Factory<ScaleGestureRecognizer>(() => ScaleGestureRecognizer()..onStart = () {myCallback()}))
       ..add(Factory<VerticalDragGestureRecognizer>(
            () => VerticalDragGestureRecognizer()..onDown = () {myCallback()})),

but only function that called was onDown. and again it worked for absolutely all gestures including onTap. But I figured that the onUpdate should worked at least. but it didn't

Kley
  • 93
  • 1
  • 1
  • 8
  • `google_maps_flutter` package includes an `onCameraMove` event on `GoogleMap` object that gets called whenever you pan the map somewhere. There is also an `onTap` event on `Marker` object that gets called whenever you tapped a certain marker. Have you tried this? – jabamataro Sep 22 '20 at 02:36
  • 1
    I need to catch the drag gesture. and no other. CamereMove works for everything, including tap. but onTap I just need to exclude – Kley Sep 22 '20 at 08:50

0 Answers0