loadAsset method

  1. @override
Future<Uint8List> loadAsset(
  1. String path
)
override

The bytes of file path; throws PublishLoadException when there is no such file.

Implementation

@override
Future<Uint8List> loadAsset(String path) async {
  final key = normalizeAssetPath(path);
  final bytes = assets[key] ?? await readAsset?.call(key);
  if (bytes == null) throw PublishLoadException('No file [$key] in the site');
  return bytes;
}