StoreDownload class
Provides bulk downloading functionality for a specific FMTCStore
By default, only one download is allowed at any one time, across all stores.
However, if necessary, multiple can be started by setting methods'
instanceId
argument to a unique value on methods. Whatever object
instanceId
is, it must have a valid and useful equality and hashCode
implementation, as it is used as the key in a Map
. Note that this unique
value must be known and remembered to control the state of the download.
Note that instances are shared across all stores.
Warning
Starting multiple simultaneous downloads may lead to a noticeable performance loss. Ensure you thoroughly test and profile your application.
Does not keep state. State and download instances are held internally by
DownloadInstance
.
- Annotations
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancel(
{Object instanceId = 0}) → Future< void> - Cancel the ongoing foreground download and recovery session
-
check(
DownloadableRegion< BaseRegion> region) → Future<int> - Count the number of tiles within the specified region
-
countTiles(
DownloadableRegion< BaseRegion> region) → Future<int> - Count the number of tiles within the specified region
-
isPaused(
{Object instanceId = 0}) → bool - Whether the ongoing foreground download is currently paused after a call to pause (and prior to resume)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
{Object instanceId = 0}) → Future< bool?> - Pause the ongoing foreground download
-
resume(
{Object instanceId = 0}) → bool? - Resume (after a pause) the ongoing foreground download
-
startForeground(
{required DownloadableRegion< BaseRegion> region, int parallelThreads = 5, int maxBufferLength = 200, bool skipExistingTiles = false, bool skipSeaTiles = true, int? rateLimit, bool retryFailedRequestTiles = true, Duration? maxReportInterval = const Duration(seconds: 1), bool disableRecovery = false, UrlTransformer? urlTransformer, Object instanceId = 0}) → ({Stream<DownloadProgress> downloadProgress, Stream<TileEvent> tileEvents}) - Download a specified DownloadableRegion in the foreground, with a recovery session by default
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited