Unable to drag marker on google map in flutter

Viewed 1743

I'm using google_maps_flutter: ^0.5.24+1 plugin. I can't drag the marker inside map even though draggable property is set true. Whats wrong here? My code :

                return GoogleMap(
                  initialCameraPosition: CameraPosition(
                    target: LatLng(placemark.position.latitude,
                        placemark.position.longitude),
                    zoom: 18,
                  ),
                  markers: Set<Marker>.of(
                    <Marker> [
                      Marker(
                        markerId: MarkerId("home"),
                        position: LatLng(placemark.position.latitude, placemark.position.longitude),
                        icon: BitmapDescriptor.defaultMarker,
                        infoWindow: InfoWindow(
                          title: placemark.name
                        ),
                        draggable: true,
                      ),
                    ]
                  ),
                  onMapCreated: (mapController) {
                    googleMapController = mapController;
                  },
                );
1 Answers

You need to long press the Marker to trigger the drag event. To debug, you can use the onDrag() property to see if the drag event has been started.

Related