bytesFor method

  1. @override
Future<Uint8List> bytesFor(
  1. String key
)
override

The bytes stored under key, little-endian, as the exporter wrote them.

Implementation

@override
Future<Uint8List> bytesFor(String key) async {
  final file = File('$root/$key');
  if (!file.existsSync()) {
    throw StateError(
      'golden "$key" is not under "$root". The exporter writes the goldens '
      'beside the artifact, so the directory has to travel with it: check '
      'that the build fetches or commits it.',
    );
  }
  return file.readAsBytes();
}