DownloadState class
Represents the current status of a file download operation.
This model tracks whether a file (identified by its remotePath) is actively being downloaded or not. It is typically used to coordinate download queue behavior, UI indicators, or analytics events.
The isDownloading flag indicates if the download is currently in progress (true)
or idle/paused/completed (false).
Example:
final state = DownloadState(
remotePath: 'media/files/sample.pdf',
isDownloading: true,
);
This class implements Equatable for easy value comparison in streams and state updates.
Constructors
- DownloadState({required String remotePath, required bool isDownloading})
-
Represents the current status of a file download operation.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDownloading → bool
-
Whether the download is currently in progress (
true) or not (false).final -
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- remotePath → String
-
The full remote path of the file being downloaded.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited
Methods
-
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