I have a google map inside column inside SingleChildScrollView. I can pan the map horizontally, but when panning vertically the SingleChildScrollView captures the event and scrolls itself. How can i pan the map when it receives any events, and scroll throught the SingleChildScrollView when the event is in other elemen
SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 12),
child: Form(
key: _formKey,
child: Column(
children: <Widget>[
someInputs...,
_buildGoogleMap(),
someOtherInpus...,
],
),
),
),
),
Widget _buildGoogleMap(BuildContext context) {
return Container(
height: 300,
padding: EdgeInsets.only(left: 25.0, right: 25.0, top: 25.0),
width: MediaQuery.of(context).size.width,
child: GoogleMap(
mapType: MapType.normal,
initialCameraPosition:
CameraPosition(target: currentUserPosition, zoom: 14),
onMapCreated: (GoogleMapController controller) {
_googleMapController.complete(controller);
},
markers: [
Marker(
markerId: MarkerId('1'),
position: LatLng(
currentUserPosition.latitude, currentUserPosition.longitude),
infoWindow: InfoWindow(title: 'Drag and hold this to location!'),
icon: BitmapDescriptor.defaultMarkerWithHue(
BitmapDescriptor.hueRed,
),
draggable: true,
onDragEnd: (LatLng latLng) {
this._dokanLatLng = latLng;
},
),
].toSet(),
),
);
so this is the code i am using to build a form that has some Textfields and a map with draggable marker so that the user can input location. The scrollview is working fine, but when i pan the google map up and down to navigate to a location, the event is not being handled by the map, the scrollview is scrolling even when i try to navigate the map. I want the map to handle its events by itself, so that the list doesnt scroll up and down when i try to pan the map vertically.