cohenadair / anglers-log

Anglers' Log is a mobile application written in Flutter that allows users to track, analyze, and share their catches in the sport of fishing.
https://anglerslog.ca/
GNU General Public License v3.0
25 stars 8 forks source link

Update to Mapbox plugin v10 #762

Open cohenadair opened 2 years ago

cohenadair commented 2 years ago

This ticket is now to migrating to the official Mapbox Flutter plugin.


========== UPDATED 6

Things seem to be working with the updated legacy plugin. Nothing to do for now.

========== UPDATED 5

The crash was not fixed with Flutter 3.7; however, it is apparently fixed with an update to the old Mapbox plugin: https://github.com/flutter-mapbox-gl/maps/pull/1293

If true, this issue can be deferred to next release.

========== UPDATED 4

Apparently, the crash is fixed with Flutter 3.7 and a Mapbox MR: https://github.com/flutter-mapbox-gl/maps/issues/1119#issuecomment-1408717486

The fix should be tested and if it works, we can delay updating to the official Mapbox plugin; perhaps until it is out of beta.

========== UPDATED 3

Official plugin is available here: https://pub.dev/packages/mapbox_maps_flutter

========== UPDATED 2

Putting this issue on hold as an official Mapbox Flutter plugin has been announced: https://github.com/flutter-mapbox-gl/maps/issues/691#issuecomment-1276453387

Will come back to this if the official plugin falls through. Note that switching to v10 doesn't necessarily mean the original crash will be fixed. We will have to see.

E: Temporarily, the crash could be fixed by https://github.com/flutter-mapbox-gl/maps/pull/1172. E2: Unfortunately, the workaround did not work for me.

========== UPDATED

Due to the crash, and Mapbox dropping support for old SDK, we'll implement a custom v10 plugin with the minimum functionality needed for Anglers' Log.

========== ORIGINAL

Due to new native crash in Flutter 3:

Workaround is to set Mapbox's myLocationEnabled to false. We'll do this, and add a custom marker for the user's current location. Update: This may not be a complete workaround since the Mapbox examples already have myLocationEnabled set to false. Some more testing is needed.

This happens every time a catch is added (caused by pushing/popping MapboxMap widgets to/from the stack), or a single fishing spot is opened (from catch details), then popped off the stack.

cohenadair commented 2 years ago

For now, going to defer this until this is fixed in Flutter.