getFailureFile method Null safety

File getFailureFile(
  1. String failure,
  2. Uri golden,
  3. Uri basedir
)

Returns the appropriate file for a given diff from a ComparisonResult.

Implementation

File getFailureFile(String failure, Uri golden, Uri basedir) {
  final String fileName = golden.pathSegments.last;
  final String testName = '${fileName.split(path.extension(fileName))[0]}_$failure.png';
  return File(path.join(
    path.fromUri(basedir),
    path.fromUri(Uri.parse('failures/$testName')),
  ));
}