DownloadAssetsController class abstract

Constructors

DownloadAssetsController()
factory

Properties

assetsDir String?
Directory that keeps all assets
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

assetsDirAlreadyExists() Future<bool>
If assets directory was already created it assumes that the content was already downloaded.
assetsFileExists(String file) Future<bool>
It checks if file already exists file -> full path to file
cancelDownload() → void
Cancel the download
clearAssets() Future
Clear all download assets, if it already exists on local storage.
init({String assetDir = 'assets', bool useFullDirectoryPath = false}) Future
Initialization method for setting up the assetsDir, which is required to be called during app initialization. assetDir -> Not required. Path to directory where your zipFile will be downloaded and unzipped (default value is getApplicationPath + assets) useFullDirectoryPath -> Not required (default value is false). If this is true the getApplicationPath won't be used (make sure that the app has to write permission and it is a valid path)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startDownload({required List<String> assetsUrls, List<UncompressDelegate> uncompressDelegates = const [UnzipDelegate()], dynamic onProgress(double)?, dynamic onCancel()?, Map<String, dynamic>? requestQueryParams, Map<String, String> requestExtraHeaders = const {}}) Future
Start the download of your content to local storage, uncompress all data and delete the compressed file. It's not required be compressed file. assetsUrls -> A list of URLs representing each file to be downloaded. (http://{YOUR_DOMAIN}:{FILE_NAME}.{EXTENSION}) uncompressDelegates -> An optional list of UncompressDelegate objects responsible for handling asset decompression, if needed. If the uncompressDelegates list is empty, the UnzipDelegate class is automatically added as a delegate for ZIP file decompression. onProgress -> It's not required. Called after each iteration returning the current progress onCancel -> Cancel the download (optional) requestQueryParams -> Query params to be used in the request (optional) requestExtraHeaders -> Extra headers to be added in the request (optional)
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited