I'm using the Syncfusion map widget for my project, and it was working fine until I made the screen that holds the map stateful. Now, after a setState() occurs, I get the following error when trying to move around:
LateInitializationError: Field '_zoomLevel@115372349' has not been initialized
I've tried using just MapZoomPanBehavior() for the zoom pan behavior parameter and the same thing happened, so It doesn't seem like I forgot to initialize it. As for the initialZoomLevel of the whole map, it is determined by a class field marked "final", so that should be initialized too.
YGYuvaraj Gajaraj Syncfusion Team March 22, 2023 11:45 AM UTC
Yes, this issue may occur when you do not initialize a local field in initState. If you have a local variable for theMapZoomPanBehaviorthen you must need to initialize it in the initState method before it is assigned to thezoomPanBehaviorproperty in theMapShapeLayerorMapTileLayerin theSfMaps. We have shared the related UG documentation below for your reference.