MirrorService class
Service for discovering and downloading MWM files from CoMaps CDN servers.
CoMaps CDN URL structure: <base>/maps/<version>/<file>
Example: https://mapgen-fi-1.comaps.app/maps/260106/Gibraltar.mwm
Constructors
-
MirrorService({Client? client, List<
Mirror> ? customMirrors})
Properties
Methods
-
discoverMirrors(
) → Future< List< MirrorDiscoveryResult> > - Discover all mirrors and their availability at runtime.
-
dispose(
) → void - Dispose of the HTTP client.
-
downloadToFile(
String url, File destination, {void onProgress(int received, int total)?}) → Future< int> - Download a file directly to disk with progress callback.
-
downloadWithProgress(
String url, {void onProgress(int received, int total)?}) → Future< List< int> > - Download a file with progress callback (legacy in-memory version).
-
getDownloadUrl(
Mirror mirror, Snapshot snapshot, MwmRegion region) → String - Build the full download URL for a region.
-
getFastestMirror(
) → Mirror? - Get the fastest available mirror.
-
getFileSize(
String url) → Future< int?> - Get file size via HEAD request.
-
getRegions(
Mirror mirror, Snapshot snapshot) → Future< List< MwmRegion> > - Get list of available regions in a snapshot.
-
getSnapshots(
Mirror mirror) → Future< List< Snapshot> > - Get list of available snapshots from a mirror.
-
measureLatencies(
) → Future< void> - Measure latency to each mirror using a HEAD request.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
defaultMirrors
→ List<
Mirror> -
CoMaps CDN servers (official, verified working).
These servers host CoMaps-specific MWM files with features like:
final
Static Methods
-
generateCandidateVersions(
{int daysToProbe = 90}) → List< String> - Generate candidate snapshot versions dynamically based on current date.