flutter_map_cache 1.4.3 copy "flutter_map_cache: ^1.4.3" to clipboard
flutter_map_cache: ^1.4.3 copied to clipboard

A slim yet powerful caching plugin for flutter_map tile layers.

example/example.md

Basic usage #

@override
Widget build(BuildContext context) {
  return FlutterMap(
    options: MapOptions(),
    children: [
      TileLayer(
        urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
        tileProvider: CachedTileProvider(
          // maxStale keeps the tile cached for the given Duration and 
          // tries to revalidate the next time it gets requested
          maxStale: const Duration(days: 30),
          // This example uses Hive as storage backend
          store: HiveCacheStore(
            path,
            hiveBoxName: 'HiveCacheStore',
          ),
        ),
      ),
    ],
  );
}

Need more information? #