Map Controller Issues
These issues appear significantly less after v2.1.0, due to the reworking of the
MapController
lifecycle.If you are experiencing these errors, please consider updating to this version or later.
This class of errors is usually caused by mis-configuring
MapController
s (see Controller), or using them in complex layouts. If you're having these issues - which can manifest as
LateInitializationError
s and/or BadState
errors - there are a few things you can try to help out:- If sharing the map controller, for example through
Provider
, make sure that the shared controller is initialised and destroyed/uninitialised at the same time as theFlutterMap
.
Last modified 5mo ago