ProgramRenderSnapshotSummary.fromJson constructor

ProgramRenderSnapshotSummary.fromJson(
  1. Map<Object?, Object?> json
)

Rebuilds a snapshot summary from serialized JSON data.

Implementation

factory ProgramRenderSnapshotSummary.fromJson(Map<Object?, Object?> json) {
  return ProgramRenderSnapshotSummary(
    sequence: _jsonInt(json['sequence']),
    renderGeneration: _jsonInt(json['renderGeneration']),
    degradationLevel:
        _jsonEnumByName(DegradationLevel.values, json['degradationLevel']) ??
        DegradationLevel.full,
    renderDuration: Duration(
      microseconds: _jsonInt(json['renderDurationUs']),
    ),
    width: _jsonNullableInt(json['width']),
    height: _jsonNullableInt(json['height']),
    frameLines: _jsonStringList(json['frameLines']),
    changeSummary: ProgramRenderChangeSummary.fromJson(
      _jsonObjectOrEmpty(json['changeSummary']),
    ),
  );
}