ComparisonIndex class

A whole index.json, read back.

Parses either file both writers produce, and the object fw compare --json prints, because the verdict is identical in all three — only the frames differ, and frames says how. See ComparisonReport for opening them.

Constructors

ComparisonIndex({int version = comparisonReportVersion, required String base, required String against, required List<ComparedItem> previewItems, required List<ScenarioComparison> scenarios, String? head, String? headCommit, DateTime? at, int ms = 0, Map<ComparedState, int> counts = const {}, ComparisonFrames frames = ComparisonFrames.local, ExportedFrames exported = ExportedFrames.all, bool narrowed = false, List<String> caveats = const [], ComparisonHost? host, ComparisonTimings? timings, ComparedHalf previewsHalf = const ComparedHalf(), ComparedHalf? scenariosHalf, String? export, String? report})
const

Properties

against → String
What the header says the comparison is against — the ref's name where the export wrote one, the abbreviated sha where it did not.
final
at → DateTime?
final
base → String
The base sha, as the artifact records it.
final
caveats → List<String>
What a reader has to know before believing the verdict, one sentence each: the ways the two sides were measured differently rather than drawn differently — trees read by two versions of flutterware, two pinned Flutter SDKs rendered with one.
final
counts → Map<ComparedState, int>
Every row either half produced, by state — the header a reader wants first. One preview that broke and one scenario that broke is two broken things; which half they came from is the second question.
final
export → String?
The exported page's directory, when fw compare --json named one.
final
exported → ExportedFrames
Which of them were written there — see ExportedFrames. Always ExportedFrames.all for a report that was never exported, whose frames are wherever the run left them.
final
findingCounts → Map<ComparedState, int>
Findings across both halves, worst first — the header's chips.
no setter
findings → List<ComparedFinding>
Every row worth attention, worst first, both halves merged.
no setter
frames → ComparisonFrames
Whether the frames this file names can be opened from beside it.
final
hashCode → int
The hash code for this object.
no setterinherited
The worktree the comparison ran in — a path, and so meaningless off the machine that ran it. headCommit is the one a reader elsewhere can use.
final
headCommit → String?
Where HEAD sat when the comparison ran, and when it ran.
final
host → ComparisonHost?
Where it ran — see ComparisonHost. Null for a file written before the key existed.
final
ms → int
Both halves together.
final
narrowed → bool
Whether the run was narrowed to named entries (--entry).
final
notCompared → List<ScenarioComparison>
The scenarios that were replayed and not compared, because a side did not produce a result — see ScenarioComparison.inconclusive.
no setter
ok → bool
True when nothing either half looked at came out worse than same — the gate, in one word.
no setter
previewItems → List<ComparedItem>
final
previewsHalf → ComparedHalf
final
report → String?
The pull-request report's directory, when --json named one.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scenarios → List<ScenarioComparison>
final
scenariosHalf → ComparedHalf?
Absent when the project declares no scenarios at all. A half that tried and could not is present, with a ComparedHalf.note.
final
scenariosNote → String?
Why the scenario half has nothing to say, when it has nothing to say.
no setter
timings → ComparisonTimings?
Where its time went — see ComparisonTimings. Null for a file written before the key existed.
final
verdictGap → String?
Why this comparison's verdict is incomplete, or null when it is whole — verdictGapOf, asked of this file.
no setter
version → int
final

Methods

framesWithheldFor(ComparedState state) → bool
Whether a row in state is one whose frames this report chose not to carry.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromJson(Map<String, Object?> json) → ComparisonIndex
Throws FormatException on a version this reader does not know: the alternative is handing back an object decoded by guesswork.