We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Wait until map is completely initialized

Is there a way to have my app wait until the map is loaded? Whenever i click something or refresh the state before it is loaded it gives me the error below. I would like to have a loaded screen that waits for this to initialize. The following LateError was thrown building FutureBuilder<_ShapeFileData>(state: _FutureBuilderState<_ShapeFileData>#b46b4): LateInitializationError: Field 'initialSelectedModel' has not been initialized.

1 Reply

YG Yuvaraj Gajaraj Syncfusion Team May 27, 2022 01:52 PM UTC

Hi Christian,


Greetings from Syncfusion. We have analyzed your query based on the provided error stack trace and we suspect that you have initialized the selected index value as a type late for initially no data was selected. This is the reason you get the issue, so we recommend you avoid initializing the selected index type as late and assign the selected index value -1 which denotes no data was selected at initial rendering. We have attached the demo sample below for your reference.


Sample: https://flutter.syncfusion.com/#/maps/shape-layer/selection


Code link: https://github.com/syncfusion/flutter-examples/blob/master/lib/samples/maps/shape_layer/selection/selection.dart


Regards,

Yuvaraj.


Loader.
Live Chat Icon For mobile
Up arrow icon