fromJson static method

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

Decodes what toJson wrote. The lists come back capped as they were written; the counts are whole, so changed.length and the count they were made from can disagree — file names the copy where they do not.

Implementation

static ScenarioRunDrift fromJson(Map<String, Object?> json) =>
    ScenarioRunDrift(
      compared: json['compared'] as int? ?? 0,
      nameMatched: json['nameMatched'] as int? ?? 0,
      unanchored: json['unanchored'] as int? ?? 0,
      baseline: json['baseline'] as String?,
      file: json['file'] as String?,
      pixelsIgnored: json['pixelsIgnored'] == true,
      changed: _steps(json['changedSteps']),
      added: _steps(json['addedSteps']),
      removed: _steps(json['removedSteps']),
    );