Map Controller Issues

This class of errors is usually caused by mis-configuring MapControllers (see Controller), or using them in complex layouts.

If you're having these issues - which can manifest as LateInitializationErrors and/or BadState errors - there are a few things you can try to help out:

  • Fully read the Controller page, and choose the right implementation/usage for your situation.

  • In complex layouts, such as with PageViews or ListViews, use the Keep Alive (keepAlive) property.

  • 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 the FlutterMap.

Last updated

Was this helpful?