как добавить всплывающее окно для отображения сведений о конкретном маркере на картах Google при нажатии или нажатии с помощью флаттера / дротика. пытался использовать функцию onTap, но дает мне ошибки любые идеи о том, как я могу добиться этого
populateHospitals() {
Hospitals = []; //array to obtain individual hospital data
Firestore.instance.collection('markers').getDocuments().then((docs) {
if (docs.documents.isNotEmpty) {
setState(() {
hospitalsToggle = true;
});
for (int i = 0; i < docs.documents.length; ++i) {
Hospitals.add(docs.documents[i].data);
initMarker(docs.documents[i].data);
}
}
});
}
initMarker(hospitals) {
mapController.clearMarkers().then((val) {
mapController.addMarker(MarkerOptions(
position:
LatLng(hospital['location'].latitude, hospital['location'].longitude),// draws the markers of the hospitals
draggable: false, // disables dragging of the marker
consumeTapEvents: true,
infoWindowText: InfoWindowText(hospital['hospitalname'], 'hospital'), //displays the hospitals name when the icon is clicked
));
});
}