ComparisonReport class

A written comparison, read back.

var report = await ComparisonReport.read('build/comparison/report/web');
if (report.index.ok) return;
for (var finding in report.index.findings) {
  print('${finding.state.name} ${finding.id}');
  if (finding.preview?.shots case var shots?) {
    if (report.frame(shots.head) case var png?) {
      await service.upload(png, finding.id);
    }
  }
}

Constructors

ComparisonReport({required String directory, required ComparisonIndex index})
const

Properties

directory → String
Where index.json was found, and what a frame reference resolves against.
final
hashCode → int
The hash code for this object.
no setterinherited
index → ComparisonIndex
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

frame(String reference) → File?
Turns a frame reference — a preview row's shots.base/shots.head, or a scenario step's FrameRef.path — into a file beside directory.
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

read(String directory) → Future<ComparisonReport>
Reads the index.json in directory.