[sdk] Add MapRecorder support for Flutter SDK #1049
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this pull request do?
This PR implements the MapRecorder API for Flutter SDK, exposing functionality that already exists in Android and iOS native SDKs.
API Surface:
mapboxMap.recorder.startRecording()
- Begin recording map interactionsmapboxMap.recorder.stopRecording()
- Stop and retrieve recorded sequencemapboxMap.recorder.replay()
- Replay recorded sequence with customization optionsmapboxMap.recorder.togglePause()
- Pause/resume playbackmapboxMap.recorder.getState()
- Get current playback stateImplementation approach:
MapboxMaps.MapRecorder
(iOS) andMapboxMapRecorder
(Android)@experimental
to match native SDK statusExample usage:
Files added:
What is the motivation and context behind this change?
Issue: #1034
Context:
MapRecorder is available in both native SDKs but missing from Flutter SDK, creating a feature gap for Flutter devs.
Use cases (per native SDK documentation):
Native SDK references:
MapRecorder
- marked@_spi(Experimental)
MapboxMapRecorder
- requires@OptIn(MapboxExperimental)
Implementation notes:
pigeons/map_recorder.dart
) as Mapbox internal tooling doesn't provide one for MapRecorder@experimental
with no version compatibility guarantee for recorded file formatTesting:
Demo Videos:
Android (Pixel 9 - API 34)
tested-android.mp4
iOS (iPhone 16 Plus)
Simulator.Screen.Recording.-.iPhone.16.Plus.-.2025-10-16.at.11.16.59.mp4
Pull request checklist:
Note on tests:
Unit tests were not added as this follows the existing pattern in the SDK. The codebase currently only has
events_test.dart
for event data serialization. Other features (annotations, offline, snapshotter) also don't have unit tests. Integration testing is handled via the example app, which demonstrates all MapRecorder features with UI controls.Note on changelog:
Will add changelog entry once PR is approved, to match the appropriate version number.