getOrCreateSymbol method
loads and returns the desired symbol, optionally rescales it to the given width and height
Implementation
@override
Future<ResourceBitmap?> getOrCreateSymbol(
String? src, int width, int height) async {
if (src == null || src.length == 0) {
// no image source defined
return null;
}
String key = "$src-$width-$height";
ResourceBitmap? resourceBitmap = _cache.get(key);
if (resourceBitmap != null) {
return resourceBitmap.clone();
}
resourceBitmap = await _createSymbol(src, width, height);
_cache.set(key, resourceBitmap);
return resourceBitmap.clone();
}