flutter_map_tile_caching
Plugin for 'flutter_map' providing advanced caching functionality, with ability to download map regions for offline use.
10.1.1
17K downloads/mo
#2384 most downloaded on pub.dev
JaffaKetchup/flutter_map_tile_caching
What this package is like to depend on
Last release 1 years ago
09 Mar 2025
Ships fairly regularly
a new release about every 4 weeks
Most releases are documented
notes for 26 of 34 stable releases
4 versions withdrawn
withdrawn after publishing
5 years old
86 releases · first in 2021
0 releases in the last 12 months
see the full history below
Release timeline
86 releases · Apr 2021 to Mar 2025Releases
latest 60 of 86-
11.0.0-dev.209 Mar 2025 pre-releaseNothing published for this version
-
11.0.0-dev.109 Mar 2025 pre-release withdrawnNothing published for this version
-
10.1.109 Mar 2025Release notes
Open source →See the full CHANGELOG for more information: https://github.com/JaffaKetchup/flutter_map_tile_caching/blob/main/CHANGELOG.md.
Release notes
Open source →- Fixed bug where import operation fatally crashed on some iOS devices
This appears to be an ObjectBox issue where streaming the results of a database query caused the crash. Instead, FMTC now uses a custom chunking system to avoid streaming and also avoid loading potentially many tiles into memory. - Improved performance of import operation
- Fixed bug where import operation fatally crashed on some iOS devices
-
10.1.002 Feb 2025Release notes
Open source →See the full CHANGELOG for more information: https://github.com/JaffaKetchup/flutter_map_tile_caching/blob/main/CHANGELOG.md.
-
10.0.011 Jan 2025Release notes
Open source →See the full CHANGELOG for more information: https://github.com/JaffaKetchup/flutter_map_tile_caching/blob/main/CHANGELOG.md.
Release notes
Open source →This update builds on v9 to fully embrace the new many-to-many relationship between tiles and stores, which allows for more flexibility when constructing the
FMTCTileProvider.
This allows a new paradigm to be used: stores may now be treated as bulk downloaded regions, and all the regions/stores can be used at once - no more switching between them. This allows huge amounts of flexibility and a better UX in a complex application. Additionally, each store may now have its ownBrowseStoreStrategywhen browsing, which allows more flexibility: for example, stores may now contain more than one URL template/source, but control is retained.Additionally, vector tiles are now supported in theory, as the internal caching/retrieval logic of the specialised
ImageProviderhas been exposed, although it is out of scope to fully implement support for it.-
Major changes to browse caching
- Added support for using multiple stores simultaneously in the
FMTCTileProvider(through theFMTCTileProvider.allStores&FMTCTileProvider.multipleStoresconstructors) - Added
FMTCTileProvider.provideTilemethod to expose internal browse caching mechanisms for external use - Added
BrowseStoreStrategyfor increased control over caching behaviour - Added 'tile loading interceptor' feature (
FMTCTileProvider.tileLoadingInterceptor) to track (eg. for debugging and logging) the internal tile loading mechanisms - Added toggle for hit/miss stat recording, to improve performance where these statistics are never read
- Replaced
FMTCTileProviderSettings.maxStoreLengthwith amaxLengthproperty on each store individually - Replaced
CacheBehaviorwithBrowseLoadingStrategy - Replaced
FMTCBrowsingErrorHandlerwithBrowsingExceptionHandler, which may now return bytes to be displayed instead of (re)throwing exception - Replaced
obscureQueryParamswith more flexibleurlTransformer(and staticFMTCTileProvider.urlTransformerOmitKeyValuesutility method to provide old behaviour with more customizability) - also applies to bulk downloading inStoreDownload.startForeground - Removed
FMTCTileProviderSettings& absorbed properties directly intoFMTCTileProvider - Performance of the internal tile image provider has been significantly improved when fetching images from the network URL
There was a significant time loss due to attempting to handle the network request response as a stream of incoming bytes, which allowed for
chunkEventsto be reported back to Flutter (allowing it to get progress updates on the state of the tile), but meant the bytes had to be collected and built manually. Removing this functionality allows the network requests to use more streamlined 'package:http' methods, which does not expose a stream of incoming bytes, meaning that bytes no longer have to be treated manually. This can save hundreds of milliseconds on tile loading - a significant time save of potentially up to ~50% in some cases!
- Added support for using multiple stores simultaneously in the
-
Major changes to bulk downloading
- Added support for retrying failed tiles (that failed because the request could not be made) once at the end of the download
- Changed result of
StoreDownload.startForegroundinto two seperate streams returned as a record, one forTileEvents, one forDownloadProgresss - Refactored
TileEvents into multiple classes and mixins in a sealed inheritance tree to reduce nullability and uncertainty & promote modern Dart features - Changed
DownloadProgress' metrics to reflect other changes and renamed methods to improve clarity and consistency with Dart recommended style - Renamed
StoreDownload.checkto.countTiles
-
Improvements for bulk downloadable
BaseRegions- Added
MultiRegion, which contains multiple otherBaseRegions - Improved speed (by massive amounts) and accuracy & reduced memory consumption of
CircleRegion's tile generation & counting algorithm - Fixed multiple bugs with respect to
startandendtiles in downloads - Deprecated
BaseRegion.(maybe)When- this is easy to perform using a standard pattern-matched switch
- Added
-
Exporting stores is now more stable, and has improved documentation
The method now works in a dedicated temporary environment and attempts to perform two different strategies to move/copy-and-delete the result to the specified directory at the end before failing. Improved documentation covers the potential pitfalls of permissions and now recommends exporting to an app directory, then using the system share functionality on some devices. It now also returns the number of exported tiles.
-
Removed deprecated remnants from v9.*
-
Other generic improvements (performance, stability, and documentation)
-
Brand new example app to demonstrate the new levels of flexibility and customizability
-
-
10.0.0-dev.730 Dec 2024 pre-releaseNothing published for this version
-
10.0.0-dev.624 Oct 2024 pre-releaseNothing published for this version
-
10.0.0-dev.520 Aug 2024 pre-releaseNothing published for this version
-
10.0.0-dev.409 Aug 2024 pre-releaseNothing published for this version
-
10.0.0-dev.322 Jul 2024 pre-releaseNothing published for this version
-
10.0.0-dev.215 Jul 2024 pre-releaseNothing published for this version
-
10.0.0-dev.128 May 2024 pre-releaseNothing published for this version
-
9.1.405 Dec 2024Release notes
Open source →See the full CHANGELOG for more information: https://github.com/JaffaKetchup/flutter_map_tile_caching/blob/main/CHANGELOG.md.
Release notes
Open source →- Fixed bug in
removeTilesOlderThanwhere actually tiles newer than the specified expiry were being removed (#172)
- Fixed bug in
-
9.1.319 Aug 2024Release notes
Open source →See the full CHANGELOG for more information: https://github.com/JaffaKetchup/flutter_map_tile_caching/blob/main/CHANGELOG.md.
Release notes
Open source →- Fixed bug where any operation that attempted to delete tiles fatally crashed on some iOS devices
This appears to be an ObjectBox issue where streaming the results of a database query caused the crash. Instead, FMTC now uses a custom chunking system to avoid streaming and also avoid loading potentially many tiles into memory.
- Fixed bug where any operation that attempted to delete tiles fatally crashed on some iOS devices
-
9.1.207 Aug 2024Release notes
Open source →See the full CHANGELOG for more information: https://github.com/JaffaKetchup/flutter_map_tile_caching/blob/main/CHANGELOG.md.
Release notes
Open source →- Fixed compilation on web platforms: FMTC now internally overrides the
FMTCObjectBoxBackendand becomes a no-op on non-FFI platforms - Minor documentation improvements
- Fixed compilation on web platforms: FMTC now internally overrides the
-
9.1.116 Jul 2024Release notes
Open source →See the full CHANGELOG for more information: https://github.com/JaffaKetchup/flutter_map_tile_caching/blob/main/CHANGELOG.md.
Release notes
Open source →- Fixed bug where errors within the import functionality would not always be catchable by the original invoker
- Minor other improvements
-
9.1.027 May 2024Release notes
Open source →See the full CHANGELOG for more information: https://github.com/JaffaKetchup/flutter_map_tile_caching/blob/main/CHANGELOG.md.
Release notes
Open source →- Upgraded to flutter_map v7 to support Flutter 3.22 (also upgraded other dependencies)
- Deprecated
BaseRegion.toDrawable, and all implementations
-
9.0.129 Apr 2024Release notes
Open source →See the full CHANGELOG for more information: https://github.com/JaffaKetchup/flutter_map_tile_caching/blob/main/CHANGELOG.md.
Release notes
Open source →- Fixed bug on initialisation, where using multiple/background
FlutterEngines would attempt to re-open a single ObjectBox Store (aka. root) multiple times
- Fixed bug on initialisation, where using multiple/background
-
9.0.011 Apr 2024Release notes
Open source →See the full CHANGELOG for more information: https://github.com/JaffaKetchup/flutter_map_tile_caching/blob/main/CHANGELOG.md.
Release notes
Open source →This update has essentially rewritten FMTC from the ground up, over hundreds of hours. It focuses on:
- improving future maintainability by improving modularity and seperation of concerns
- improving stability & performance across the board
- supporting a many-to-many relationship between tiles and stores to reduce duplication
I would hugely appricate any donations - please see the documentation site, GitHub repo, or pub.dev package.
I would also like to thank all those who have been waiting and contributing their feedback throughout the process: it means a lot to me that FMTC is such a crucial component to your application.
And without further ado, let's get the biggest changes out of the way first:
-
Added support for modular storage/root backends through
FMTCBackend- Removed Isar support
Isar unfortunately caused too many stability issues, and is not as actively maintained as I would like (I can sympathise :D). - Added ObjectBox as the default backend (
FMTCObjectBoxBackend)
ObjectBox uses the same underlying database technology as Isar (MBDX), but is more maintained, and I'm hoping, more stable. Note that ObjectBox declares it only supports 64-bit systems, whereas Isar was just 'mostly unstable' on 32-bit systems until recently (where is also became 64-bit only): it's time for the future! - It is expected that backends support a many-to-many relationship between tiles and stores
This has reduced duplication between stores and tiles massively, and now allows for smaller, fine-grained region control. The default backend supports this with as minimal hit to performance as possible, although of course, database operations are now considerably more complex than in previous versions, and so therefore will take slightly longer. In practise, there is no noticeable performance difference. - It is expected that backends cache statistics instead of calculating them at get time
This has decreased the time spent fetching basic statistics, and allowed for increased efficiency when getting multiple stats at once. Of course, there is some impact on performance at write time: it must all be accurately tracked, else it will be inaccacurate/out-of-sync.
- Removed Isar support
-
Restructured top-level access APIs
- Deprecated
StoreDirectory&RootDirectoryin favour ofFMTCStoreandFMTCRoot
The term 'directory' has been misleading for a couple of years now, as it hasn't been actual filesystem directories storing information since the introduction of v7. - Removed the
FlutterMapTileCaching/FMTCaccess object, in favour ofFMTCStoreandFMTCRootdirect constructors
Much of the configuration and state management performed by this top-level object and it's close relatives were transferred to the backend, and as such, there is no longer a requirement for these objects. - Removed support for synchronous operations (and renamed asynchronous operations to reflect this)
These were incompatible with the newIsolatedFMTCObjectBoxBackend, and to keep scope reasonable, I decided to remove them, in favour of backends implementing their ownIsolateion as well.
- Deprecated
-
Reimplemented bulk downloading
- Added
CustomPolygonRegion, aBaseRegionthat is formed of any* outline - Added pause and resume functionality
- Added rate limiting functionality
- Added support for multiple simultaneous downloads
- Improved developer experience by refactoring
DownloadableRegionandstartForeground - Improved download speed significantly
- Fixed instability and bugs when cancelling buffering downloads
- Fixed generation of
LineRegiontiles by reducing number of redundant duplicate tiles - Fixed usage of
obscuredQueryParams - Removed support for bulk download buffering by size capacity
- Removed support for custom
HttpClients
- Added
-
Deprecated plugins
- Transfered support for import/export operations to core (
RootExternal) - Deprecated support for background bulk downloading
- Transfered support for import/export operations to core (
-
Migrated to Flutter 3.19 and Dart 3.3
-
Migrated to flutter_map v6
With those out of the way, we can take a look at the smaller changes:
- Improved recovery system to monitor which tiles can be skipped on re-downloading (via
DownloadableRegion.start) - Improved error handling (especially in backends)
- Added
StoreManagement.pruneTilesOlderThanmethod - Added shortcut for getting multiple stats:
StoreStats.all - Added secondary check to
FMTCImageProviderto ensure responses are valid images - Replaced public facing
RegionType/typewith Dart 3 exhaustive switch statements throughBaseRegion/DownloadableRegion.when&RecoverableRegion.toRegion - Removed HTTP/2 support
- Fixed a whole bunch of bugs
In addition, there's been more action in the surrounding enviroment:
- Created a miniature testing tile server
- Created automated tests for tile generation
- Improved & simplified example application
- Removed update mechanism
- Added tile-by-tile/live download following
-
9.0.0-dev.803 Apr 2024 pre-releaseNothing published for this version
-
9.0.0-dev.707 Mar 2024 pre-releaseNothing published for this version
-
9.0.0-dev.607 Mar 2024 pre-release withdrawnNothing published for this version
-
9.0.0-dev.509 Oct 2023 pre-releaseNothing published for this version
-
9.0.0-dev.429 Jul 2023 pre-releaseNothing published for this version
-
9.0.0-dev.311 Jul 2023 pre-releaseNothing published for this version
-
9.0.0-dev.204 Jun 2023 pre-releaseNothing published for this version
-
9.0.0-dev.120 May 2023 pre-releaseNothing published for this version
-
8.0.129 Jul 2023 -
8.0.005 May 2023Release notes
Open source →- Bulk downloading has been rewritten to use a new implementation that generates tile coordinates at the same time as downloading tiles
checking the number of tiles in a region now uses a significantly faster and more efficient implementation- Starting a download no longer causes significant memory bloat, which could crash the app on large regions
- Starting a download is now much quicker and closer to constant time, as tile coordinates don't need to be pre-generated
- Cancelling a download no longer causes many
QueueCancelledExceptions to be thrown, which could crash the app - Removed reliance on 'queue' dependency in order to squeeze as much speed as possible out of the new implementation
- Other improvements
initialisenow automatically renames databases if their filename ID doesn't match their name hashinitialisecan now throw a more usefulFMTCInitialisationExceptionwith improved clarity- Methods that require a valid store descriptor object to be present now throw
FMTCDamagedStoreExceptionif it is not present
- Other bug fixes
FMTCImageProvider's oldest tile deleter & bulk downloading now respects custom root directoriesFMTCImageProvidernow evicts failed images from Flutter'sImageCacheto prevent errors
- Added support for custom
HttpClients/BaseClients - Added support for Isar v3.1 (bug fixes & stability improvements)
Version 7 was made unstable due to a non-semantic versioning compliant update of a dependency.
This means the pub version resolver can never resolve FMTC v7 without introducing compilation errors.[7.2.0] - 2023/03/03
- Stability improvements
- Starting multiple downloads no longer causes
LateInitializationErrors - Migrator storage and memory usage no longer spikes as significantly as previously, thanks to transaction batching
- Opening and processing of stores on initialisation is more robust and less error-prone to filename variations
- Root statistic watching now works on all platforms
- Starting multiple downloads no longer causes
- Multiple minor bug fixes and documentation improvements
- Added
maxStoreLengthconfig to example app
[7.1.2] - 2023/02/18
- Minor bug fixes
[7.1.1] - 2023/02/16
- Major bug fixes
- Added debug mode
[7.1.0] - 2023/02/14
- Added URL query params obscurer feature
- Added
headersandhttpClientparameters togetTileProvider - Minor documentation improvements
- Minor bug fixes
[7.0.2] - 2023/02/12
- Minor changes to example application
[7.0.1] - 2023/02/11
- Minor bug fixes
- Minor improvements
[7.0.0] - 2023/02/04
- Migrated to Isar database
- Major performance improvements, thanks to Isar
- Added buffering to bulk tile downloading
- Added method to catch tile retrieval errors
- Removed v4 -> v5 migrator & added v6 -> v7 migrator
- Removed some synchronous methods from structure management
- Removed 'fmtc_advanced' import file
Plus the usual:
- Minor performance improvements
- Bug fixes
- Dependency updates
- Documentation improvements
- Bulk downloading has been rewritten to use a new implementation that generates tile coordinates at the same time as downloading tiles
-
8.0.0-dev.627 Apr 2023 pre-releaseNothing published for this version
-
8.0.0-dev.517 Apr 2023 pre-releaseNothing published for this version
-
8.0.0-dev.404 Apr 2023 pre-releaseNothing published for this version
-
8.0.0-dev.303 Apr 2023 pre-releaseNothing published for this version
-
8.0.0-dev.228 Mar 2023 pre-releaseNothing published for this version
-
8.0.0-dev.118 Mar 2023 pre-releaseNothing published for this version
-
7.2.003 Mar 2023Nothing published for this version
-
7.1.218 Feb 2023Nothing published for this version
-
7.1.116 Feb 2023Nothing published for this version
-
7.1.014 Feb 2023 withdrawnNothing published for this version
-
7.0.212 Feb 2023Nothing published for this version
-
7.0.111 Feb 2023 withdrawnNothing published for this version
-
7.0.004 Feb 2023Nothing published for this version
-
7.0.0-dev.513 Jan 2023 pre-releaseNothing published for this version
-
7.0.0-dev.406 Jan 2023 pre-releaseNothing published for this version
-
7.0.0-dev.328 Dec 2022 pre-releaseNothing published for this version
-
7.0.0-dev.220 Dec 2022 pre-releaseNothing published for this version
-
7.0.0-dev.118 Dec 2022 pre-releaseNothing published for this version
-
6.2.025 Oct 2022 -
6.1.023 Sep 2022Release notes
Open source →- Fixed bugs within import functionality
- Added support for notifications on Android 13+
- Improved performance
- Updated dependencies
-
6.0.111 Sep 2022 -
6.0.1-beta10 Sep 2022 pre-releaseNothing published for this version
-
6.0.005 Sep 2022Release notes
Open source →- Added support for flutter_map v3
- Fixed bugs
- Improved example application
-
6.0.0-beta13 Aug 2022 pre-releaseNothing published for this version
-
5.1.112 Aug 2022 -
5.1.009 Aug 2022Release notes
Open source →- Added import/export functionality
- Improved example application
- Improved documentation
- Fixed bugs
-
5.0.003 Aug 2022Release notes
Open source →- Renamed and refactored internal and public APIs, ready for release
- Added
successfulSizestatistic toDownloadProgress - Improved example application
- Improved documentation
- Fixed bugs
-
5.0.0-dev.629 Jul 2022 pre-releaseRelease notes
Open source →- Polish and preparations for full v5 release
- Moved
migratorintorootDirectoryto fix bugs - Converted
DownloadManagementto a singleton object - Finished example application
- Improved documentation
- Fixed bugs
-
5.0.0-dev.525 Jul 2022 pre-releaseRelease notes
Open source →- Improved download time estimates and added tiles per second statistic
- Added custom filesystem string sanitiser setting to
FMTCSettings - Improved statistic watchers
- Improved example application
- Improved documentation
- Fixed bugs
-
5.0.0-dev.419 Jul 2022 pre-releaseRelease notes
Open source →- Added cache hits and misses statistics
- Added v4 to v5 file structure migration methods
- Reworked
invalidateCachedStatistics - Improved documentation
- Fixed bugs
-
5.0.0-dev.317 Jul 2022 pre-releaseRelease notes
Open source →- Improved example application
- Updated Gradle for example application
- Improved documentation
- Improved background downloading implementation
- Added support for 'flutter_map' v2.0.0
- Added Windows support to example application
- Fixed multiple bugs