MapRecorder class
MapRecorder provides functions to record and replay API calls of a MapboxMap instance.
These recordings can be used to debug issues which require multiple steps to reproduce. Additionally, playbacks can be used for performance testing custom scenarios.
Note: The raw format produced by stopRecording is experimental and there is no guarantee for version cross-compatibility when feeding it to replay.
Warning: This API is experimental and may change in future releases.
Example:
// Start recording
await mapboxMap.recorder.startRecording(
timeWindow: Duration(seconds: 60),
loggingEnabled: true,
compressed: true,
);
// ... perform some map interactions ...
// Stop recording and get the recorded sequence
final recordedSequence = await mapboxMap.recorder.stopRecording();
// Replay the sequence twice at 2x speed
await mapboxMap.recorder.replay(
recordedSequence,
playbackCount: 2,
playbackSpeedMultiplier: 2.0,
avoidPlaybackPauses: false,
);
- Annotations
-
- @experimental
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getState(
) → Future< String> - Returns the current playback state.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replay(
Uint8List recordedSequence, {int playbackCount = 1, double playbackSpeedMultiplier = 1.0, bool avoidPlaybackPauses = false}) → Future< void> - Replay a supplied sequence.
-
startRecording(
{Duration? timeWindow, bool loggingEnabled = false, bool compressed = false}) → Future< void> - Begins the recording session.
-
stopRecording(
) → Future< Uint8List> - Stops the current recording session.
-
togglePause(
) → Future< void> - Temporarily pauses or resumes playback if already paused.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited