loadStructuredBinaryData<T> method
Retrieve ByteData from the asset bundle, parse it with the given function, and return that function's result.
The result is not cached by the default implementation; the parser is run each time the resource is fetched. However, some subclasses may implement caching (notably, subclasses of CachingAssetBundle).
Implementation
@override
// ignore: override_on_non_overriding_member
Future<T> loadStructuredBinaryData<T>(
String key, FutureOr<T> Function(ByteData data) parser) {
if (!_enableStructuredDataTracing) {
return _loadStructuredBinaryDataWrapper(key, parser);
}
final outerSpan = _hub.getSpan();
return _wrapLoad(
outerSpan,
'loadStructuredBinaryData',
key,
() => _loadStructuredBinaryDataWrapper(
key,
(value) => _wrapParser(
outerSpan,
key,
() => Future.value(parser(value)),
),
),
);
}