FMTC Docs
Project Links💝 Support Me
v9
v9
  • flutter_map_tile_caching
  • ❔Is FMTC Right For Me?
  • 💝Supporters
  • 📃(Proprietary) Licensing
  • 🚀Get Started
    • Quickstart
    • Installation
    • Example Application
    • v8 -> v9 Migration
    • Full API Reference
  • 🌐General
    • Initialisation
    • Backends
    • Error Handling
    • Tips
  • 📂Stores & Roots
    • Introduction
    • Stores
      • Management
      • Statistics
      • Metadata
    • Roots
      • Statistics
      • Recovery
    • flutter_map Integration
  • 📲Bulk Downloading
    • Introduction
    • 1️⃣Create A Region
    • 2️⃣Prepare For Downloading
    • 3️⃣Start Download
    • Control Downloads
    • Testing Tile Server
  • 🗃️External
    • Introduction
    • Exporting
    • Importing
  • flutter_map Docs
Powered by GitBook

© Luka Stillingfleet (JaffaKetchup)

On this page

Was this helpful?

Export as PDF
  1. Stores & Roots
  2. Roots

Recovery

PreviousStatisticsNextflutter_map Integration

Last updated 1 year ago

Was this helpful?

RootRecovery, accessed via FMTCRoot.recovery, allows access to the bulk download recovery system, which is designed to allow rescue (salvation and restarting) of failed downloads when they crashed due to an unexpected event.

final rec = FMTCRoot.recovery;

await rec.recoverableRegions; // List all recoverable regions, and whether each one has failed
await rec.recoverableRegions.failedOnly; // List all failed downloads
await stats.getRecoverableRegion(); // Retrieve a specific recoverable region by ID
await stats.cancel(); // Safely remove the specified recoverable region

Restoring Usable Regions

Once a RecoveredRegion has been retreived, it can be converted to a standard region:

  • either a DownloadableRegion, using toDownloadable The start tile will be adjusted from the original to reflect the progress of the download before it failed, meaning that tiles already successfully cached (excluding buffered) will not be downloaded again, saving time and data! The end tile will be either the original, or the maximum number of tiles normally in the region (which will have no resulting difference than null, but allows for a quick estimate of the number of remaining tiles to be made without needing to recheck the entire region).

  • or a BaseRegion (with the correct subtype), using toRegion

📂
RootRecovery class - flutter_map_tile_caching library - Dart API
Logo