FileSymbolCache class

A cache for symbols (small bitmaps used in the map, e.g., stop signs, arrows).

This class loads symbols from various sources (e.g., assets, files) and caches them in memory to improve performance. It supports different image formats like SVG and PNG, and can resize symbols on the fly.

The src parameter for symbols specifies the filename, including the extension, starting from the assets path (e.g., "patterns/arrow.png").

Constructors

FileSymbolCache({ImageBuilder imageBuilder = const ImageBuilder()})
Creates a new FileSymbolCache.

Properties

hashCode int
The hash code for this object.
no setterinherited
imageBuilder → ImageBuilder
final
imageLoaders Map<String, ImageLoader>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addLoader(String prefix, ImageLoader imageLoader) → void
Adds a new ImageLoader for a given prefix.
dispose() → void
Disposes the cache and releases all its resources.
getOrCreateSymbol(String? src, int width, int height) Future<SymbolImage?>
Retrieves a symbol from the cache or creates it if it doesn't exist.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited