How mapbox/mapbox-maps-flutter works
Project type and purpose
• This is a Flutter plugin (mapbox_maps_flutter) that provides a cross-platform binding for the native Mapbox Maps SDK (Android & iOS).
• It exposes a Dart API (lib/) that communicates via Pigeon/Platform Channels to native controllers (android/src and ios/Sources), which in turn drive the underlying Mapbox Maps SDK.
File structure
• Top‐level directories:
• lib/ ← Dart plugin interface and implementation
• android/ ← Android platform code (Kotlin controllers, Pigeon handlers, Gradle build)
• ios/ ← iOS platform code (Swift controllers, generated messengers, CocoaPods spec)
• example/ ← Flutter example app demonstrating plugin usage
• test/ ← Dart unit tests
• scripts/, .circleci/, .github/ ← CI, formatting, versioning, deployment
• Notice the Pigeon‐generated messenger classes under android/src/.../pigeons and ios/.../Generated.
• The plugin glues Flutter → Pigeon → native controllers → native SDK.
README for additional insights
• The README describes supported features, installation (including Dart API), and platform prerequisites.
• It shows how the MapWidget/Dart MapboxMap controller maps 1:1 to the native APIs.
Be detailed but avoid over-fragmentation
• Related controllers (annotation, style, viewport) rather than listing every file.
• High-level flow: Flutter UI → Dart plugin → cross‐platform bridge → native controllers → native SDK → network services.