A versatile mapping package for Flutter. Simple and easy to learn, yet completely customizable and configurable, it's the best choice for mapping in your Flutter app.
I have FlutterMap inside Consumer widget (using Provider package) as this is required to set screen into loading state when waiting for API request response. When the screen is rebuilt using notifyListeners(), new instances of MapController and MapOptions are assigned to FlutterMap. However, upon first rebuild, this error is thrown:
The following assertion was thrown building Container:
Should not update options unless they change
'package:flutter_map/src/map/controller/map_controller_impl.dart':
Failed assertion: line 342 pos 7: 'newOptions != value.options'
I'm not sure how this is possible as the new instance of every object should not be equal to any other object. Here is my code (vm = ViewModel/ChangeNotifier):
What is the bug?
I have FlutterMap inside Consumer widget (using Provider package) as this is required to set screen into loading state when waiting for API request response. When the screen is rebuilt using notifyListeners(), new instances of MapController and MapOptions are assigned to FlutterMap. However, upon first rebuild, this error is thrown:
I'm not sure how this is possible as the new instance of every object should not be equal to any other object. Here is my code (vm = ViewModel/ChangeNotifier):
How can we reproduce it?
Use Consumer widget in combination with ChangeNotifier to rebuild the following map:
Do you have a potential solution?
Remove assertion, or perhaps add
key
property to MapOptions so new object with same parameters can be attached?Platforms
Android 14
Severity
Erroneous: Prevents normal functioning and causes errors in the console