DownloadOption class
A data class for downloadFile, which is used to describe some downloading options.
Constructors
- DownloadOption({DownloadBehavior behavior = DownloadBehavior.preferUsingCache, RedecideFilepathHandler? redecideHandler, bool ignoreHeadError = false, FilepathConflictHandler conflictHandler = _defaultConflictHandler, FilepathSuffixBuilder suffixBuilder = _defaultSuffixBuilder, bool alsoUpdateCache = false, Duration maxAgeForCache = const Duration(days: 30), Duration? headTimeout, Duration? downloadTimeout})
-
const
Properties
- alsoUpdateCache → bool
-
The flag to update cache only when data downloading is finished. Note that if valid data is found
from cache and used to save file, the cache item will never be updated.
final
- behavior → DownloadBehavior
-
The download behavior, defaults to DownloadBehavior.preferUsingCache.
final
- conflictHandler → FilepathConflictHandler
-
The filepath conflict handler, with conflicted filepath given, defaults to not allow overwriting.
final
- downloadTimeout → Duration?
-
The timeout duration of downloading file, defaults to do not check timeout.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headTimeout → Duration?
-
The timeout duration of http HEAD request, defaults to do not check timeout.
final
- ignoreHeadError → bool
-
The flag to ignore errors when making http HEAD request, otherwise it will throw DownloadException
with DownloadErrorType.head.
final
- maxAgeForCache → Duration
-
The max age duration for cache updating, defaults to
const Duration(days: 30)
.final - redecideHandler → RedecideFilepathHandler?
-
The filepath redeciding handler, usually for file extension checking, with the header of HEAD
response and its Content-Type given, defaults to null.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- suffixBuilder → FilepathSuffixBuilder
-
The filepath suffix builder, and this suffix will be added to the end of the basename of filepath,
defaults to " ($index)". Note that is will only be used for DownloadConflictBehavior.addSuffix.
final
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