loadBytes method
Loads the SVG bytes, utilizing caching to avoid unnecessary repeated loads.
This method intentionally avoids using await
to help tests
and reduce unnecessary event loop turns.
Implementation
@override
Future<ByteData> loadBytes(BuildContext? context) {
return svg.cache.putIfAbsent(cacheKey(context), () => _load(context));
}