It seems the onMapCreated()
method says in document
Callback method for when the map is ready to be used.
I want to take snapshot when the map is rendered. the problem is when I take screenshot the map is not even rendered. I just get the blank screenshot then sometimes it works well!
///
void takeSnapShot() async {
GoogleMapController controller = await _mapController.future;
Future<void>.delayed(const Duration(milliseconds: 1500), () async {
if (mounted) {
imageBytes = await controller.takeSnapshot();
setState(() {});
}
});
}
I call this method inside the onMapCreated()
method!