ApiService class

A singleton service responsible for managing APK downloads.

This class handles network operations, tracking download progress, calculating download speed, and safely managing file cancellations and partial deletions.

Constructors

ApiService()
Returns the singleton instance of ApiService.
factory

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

cancelDownload({bool deletePartialDownload = false}) Future<void>
Cancels the currently active download.
downloadFile({required String downloadFileUrl, void onProgress(double progress)?, void onError(String error)?, void onTimeLeft(String error)?, void onSpeed(String error)?, void onTotalSize(String error)?, void onDownloadedSize(String error)?, String? downloadFileName, bool deleteOnError = false}) Future<String?>
Downloads a file from the provided URL to the device's external storage.
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