I want to bring a modal bottom sheet upon clicking a google map marker and display some dynamic data using flutter


Solution 1: Bernardo Ferreira

You can program the onTap event of the marker to show a modal bottom sheet:

  final Marker marker = Marker(
    markerId: markerId,
    position: LatLng(lat, lon),
    onTap: () {
      controller.animateCamera(CameraUpdate.newCameraPosition(
          new CameraPosition(
              target: LatLng(lat, lon), zoom: 18)));
      showModalBottomSheet(
          context: context,
          builder: (builder) {
            return Container(
              child: _buildBottonNavigationMethod(your_data),
            );
          });
    },
  );

And here you build your widget as you want:

Column _buildBottonNavigationMethod(your_data) {
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        ListTile(
          leading: Icon(Icons.ac_unit),
          title: Text('Add as favourite'),
        )
      ],
    );
  }