Closed cedrichansen closed 4 years ago
Have found the source of the bug. I was creating these markers in initState(), and adding these markers to a set of markers, which was then assigned to the markers param on the google maps widget - But since loading the custom markers is an async call, the images/markers may not finish loading by the time the first build method is finished.
In order to resolve this, in initState, call
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
Marker m = (... Create marker with custom icon from assets folder)
GoogleMap.of(_key).addMarker(m);
})
Hopefully anyone else who runs into this same issue may find my solution helpful.
Other suggestions/fixes are welcome!
I will mark this issue as closed
Custom markers are not displayed in debug mode (ie flutter run -d), but are displayed when running in release mode (flutter run -d --release).
By custom pins, i mean doing the following:
If I remove the "icon:" param, the default pin is displayed in both debug and release mode.
This is NOT an issue on web, but is an issue on android (not sure about ios)