BuiltInMapCachingProvider class abstract interface

Simple built-in map caching using an I/O storage mechanism, for native (non-web) platforms only

Stores tiles as files identified with keys, containing some metadata headers followed by the tile bytes, alongside a file used to track the size of the cache.

Usually uses HTTP headers to determine tile freshness, although overrideFreshAge can override this.

This is enabled by default in flutter_map, when using the NetworkTileProvider (or cancellable version).

It is safe to use all public methods when running on web - they will noop.

For more information, see the online documentation.

Implemented types

Constructors

BuiltInMapCachingProvider.getOrCreateInstance({String? cacheDirectory, int? maxCacheSize = 1_000_000_000, String tileKeyGenerator(String url)?, Duration? overrideFreshAge, bool readOnly = false})
If an instance exists, return it, otherwise create a new instance
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isSupported bool
Whether this caching provider is "currently supported": whether the tile provider should attempt to use it, or fallback to a non-caching alternative
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

destroy({bool deleteCache = false}) Future<void>
Destroy this caching provider instance
getTile(String url) Future<CachedMapTile?>
Retrieve a tile from the cache, if it exists
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putTile({required String url, required CachedMapTileMetadata metadata, Uint8List? bytes}) Future<void>
Add or update a tile in the cache
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

uuidTileKeyGenerator(String url) String
Default tileKeyGenerator which generates v5 UUIDs from input strings