load method
- WebLicenseText text
Implementation
Future<String> load(WebLicenseText text) async {
final Map<String, dynamic> chunk = await _chunks.putIfAbsent(
text.file,
() async =>
jsonDecode(await bundle.loadString('web-licenses/${text.file}'))
as Map<String, dynamic>,
);
final Object? found = chunk[text.sha256];
if (found is! String) {
throw FormatException('${text.file} holds no text ${text.sha256}');
}
return found;
}