Open V3ntus opened 8 months ago
Looks like it could be slightly related to #42, I'll try to pull latest master and test with that
Pulled latest master of this repo, no changes. Even refactored my code to look more like the example (instantiate the Polygon during widget instantiation, but dynamically clear/add the points when the user selects another polygon), no change. I'll look into exploring other state management solutions and have the PolygonLayer for "testPolygon" wrapped in a Consumer
I believe the issue is caused by Flutter (or at least my implementation) not detecting changes due to this library using list mutation: https://github.com/ibrierley/flutter_map_line_editor/blob/753e3268d4622ae19b0d2af6d5c40a49b13512b3/lib/src/poly_editor.dart#L28 https://github.com/ibrierley/flutter_map_line_editor/blob/753e3268d4622ae19b0d2af6d5c40a49b13512b3/lib/src/poly_editor.dart#L40
I was able to get my desired behavior by reassigning points
after each marker operation:
points = List.from(points);
In the screenshot, the drag marker can be interacted with, but it does not rebuild the PolygonLayer. No console output either, but callbackRefresh does get called.
Versions:
flutter_map: git+95ff0191981b87b24430ef434d7806e5a3017a50
flutter_map_dragmarker: 6.0.0
flutter_map_line_editor: 6.0.0
I am using bleeding-edge flutter_map as I require hit testing for the polygons. My app's map will be projecting multiple polygons that will be available to the user to edit and interact with as they please.