flutter_map_cache
2.1.2, released 11 days ago by joscha-eckert.de
A slim caching plugin for flutter_map tile layers supporting multiple storage backends.
What it does
It intercepts tile requests in flutter_map using Dio and caches map tiles to reduce network usage, lower server load, and improve map loading performance. It supports backends like File System, Drift, Hive CE, ObjectBox, Isar, and Sembast.
AI-written summary of version 2.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are using flutter_map and need to cache map tiles to comply with tile usage policies.
- You want to reduce mobile data usage and load previously visited map regions instantly offline.
- You need advanced caching backends like Drift, Hive, or Isar instead of the default flutter_map caching.
Skip it when
- You want a fully automated offline map downloader since this package only caches tiles as they are visited.
- You are using only sqflite and prefer not to use Drift or other supported storage stores.
Strengths
- Supports multiple storage backends including File System, Drift, and Hive CE.
- Includes tile request cancellation out of the box.
- Reduces mobile data consumption and speeds up repeat visits to map regions.
Weaknesses
- Does not provide automated bulk tile downloading for complete offline maps.
- Requires choosing and configuring an additional storage backend package.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 3
Requires adding flutter_map_cache along with a chosen storage store package (such as http_cache_file_store or http_cache_hive_store) and setting up paths via path_provider.
FlutterMap(
options: MapOptions(),
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
tileProvider: CachedTileProvider(
maxStale: const Duration(days: 30),
store: HiveCacheStore(path, hiveBoxName: 'HiveCacheStore'),
),
),
],
)Alternatives
Packages that do the same job and could replace flutter_map_cache.
- google_maps_flutter_web
Web platform implementation of google_maps_flutter.
88Compare - google_maps_flutter_android
Android implementation of the google_maps_flutter plugin.
82Compare - google_maps_flutter_ios
iOS implementation of the google_maps_flutter plugin.
81Compare - maplibre_gl
Native MapLibre maps for Android, iOS and Web with vector tiles, PMTiles, GeoJSON and offline support
91Compare
Works with
Packages commonly used together with flutter_map_cache: ones it builds on, ones built on it, and its own family.
- dioflutter_map_cache depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- flutter_mapflutter_map_cache depends on itPure‑Flutter map client with tile loading, markers, and gestures
- dio_cache_interceptorflutter_map_cache depends on itDio HTTP cache interceptor with multiple stores respecting HTTP directives.
- flutter_map_compassSame familyA simple compass widget for flutter_map displaying rotation and resetting it when tapped.
- flutter_map_mbtilesSame familyOffline raster tile provider for flutter_map using MBTiles
- flutter_map_pmtilesSame familyPMTiles tile provider for flutter_map supporting local or hosted files.
- flutter_map_maplibreSame familyMapbox Vector Tiles support for flutter_map powered by native MapLibre SDKs.