replaySnapshot method

Future<String> replaySnapshot(
  1. SnapshotId snapshotId, {
  2. int? fromStep,
  3. int? toStep,
  4. num? scale,
})

Replays the layer snapshot and returns the resulting bitmap. snapshotId The id of the layer snapshot. fromStep The first step to replay from (replay from the very start if not specified). toStep The last step to replay to (replay till the end if not specified). scale The scale to apply while replaying (defaults to 1). Returns: A data: URL for resulting image.

Implementation

Future<String> replaySnapshot(SnapshotId snapshotId,
    {int? fromStep, int? toStep, num? scale}) async {
  var result = await _client.send('LayerTree.replaySnapshot', {
    'snapshotId': snapshotId,
    if (fromStep != null) 'fromStep': fromStep,
    if (toStep != null) 'toStep': toStep,
    if (scale != null) 'scale': scale,
  });
  return result['dataURL'] as String;
}