Loader class IO
Manages and tracks the progress of multiple asynchronous loading operations.
The Loader
keeps a list of LoaderItems and provides overall
progress information, such as total bytes loaded, total bytes expected,
and an overall percentage. This is useful for implementing loading screens
or progress indicators in an application.
The App instance uses this to determine if it should show the loading screen App.onLoading.
If you dont want to call the App.onLoading method automatically you can disabled it by setting Loader.isEnabled to false.
Constructors
- Loader()
Properties
- allItemsFinished → bool
-
Indicates whether all individual LoaderItems have completed loading
(either successfully or with an error).
no setter
- done → bool
-
Indicates whether the entire loading process is considered complete.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEnabled ↔ bool
-
Set this to false if you don't want your App instance automatically
calling App.onLoading if loading sequence is in progress.
getter/setter pair
- length → int
-
The number of items currently being tracked by the loader.
no setter
- loaded → int
-
The total number of bytes loaded across all tracked items.
no setter
- loadingSequenceFinished ↔ bool
-
Indicates whether the initial sequence of adding items to the loader
is considered finished.
getter/setter pair
- percent → double
-
Returns the overall loading percentage (on a scale from 0.0 to 1.0).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- total → int
-
The total number of bytes expected across all tracked items.
This sum only includes items where the total size is known.
no setter
Methods
-
add(
String source) → LoaderItem - Adds a new item to be tracked by the loader.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → dynamic - Clears all tracked items from the loader.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited