Muhammed Emin Aydın
Muhammed Emin Aydın

Reputation: 127

How to Attach a Pan Gesture Listener on Flutter HERE SDK?

I want to trigger else block in this method while the user is navigating the maps with the pan gesture.

  void setTracking(bool isTracking) {
    if (isTracking) {
      _visualNavigator.cameraMode = CameraTrackingMode.enabled;

    } else {
      _visualNavigator.cameraMode = CameraTrackingMode.disabled;
    }
  }

In this way, the user will be able to look at other places on the map while using the navigation. How can I do that?

Upvotes: 0

Views: 199

Answers (1)

Muhammed Emin Aydın
Muhammed Emin Aydın

Reputation: 127

Here is the solution;

 void _trackingOffOnPanGesture(){
    _hereMapController.gestures.panListener = PanListener((state, origin, translation, velocity) {
      _visualNavigator!.cameraMode = CameraTrackingMode.disabled;
    });
  }

Upvotes: 1

Related Questions