ProgressList class final
The tasks of a tracker, a row each, with the columns it is given: the mark of each task's TaskItemStatus as a TaskList shows it, its label, a bar as a ProgressBar draws it — sweeping while the task runs without a total — and how far it has got, how fast it goes and the time it has left:
⠹ Downloading assets.zip █████████████▌ 62% 1.2 MB/s • ETA 00:04
✓ Building binary ████████████████████ 100% 3.1 s
The columns line up across the rows, each as wide as the widest of its cells, those of the amounts right-aligned; a column empty in every row takes no room. The label column is as wide as the longest label, the bar takes the rest. Where the row is short, the labels are cut off with an ellipsis before the bar is narrower than 10 cells, then, at 8 cells of label, the bar narrows and goes, then the columns after it from the last.
With hideFinished the tasks done or skipped are not shown, the
failed ones still are. With maxVisible, at most that many rows of
tasks are shown — the running ones first, then the pending, the
failed and the rest — in their order, and a row +3 more for those
that are not.
The list is as tall as its rows and as wide as it may be; a repaint boundary. It is built again when the tracker tells its listeners, and while a task it shows runs, at each step of the spinner on the app's clock, which repaints the rows with what the tasks have done since: a million ProgressTask.advance calls a second cost a frame a step. A bar sweeping moves at the ProgressBar.steps, as the others do. Outside an app the spinner shows its first frame and nothing moves.
The times in its rows — elapsed, rate, time left — are the tasks',
read on the tracker's ProgressTracker.clock, which the list leaves
as it is: where a test's fake clock is to move them, the tracker is
made with the app's clock (AppBinding.of(context).twkApp.clock).
A screen reader reads it as a list of progress bars, each with its
label and how much is done (progressbar Downloading assets.zip: 62%),
a task not running with its status as the hint.
A list of what a tracker runs:
ProgressList(
tracker: tracker,
columns: const [
ProgressColumn.mark,
ProgressColumn.label,
ProgressColumn.bar,
ProgressColumn.percent,
ProgressColumn.eta,
],
hideFinished: true,
)
See also:
- TaskList, for tasks without amounts, given as values.
- ProgressBar, one bar on its own.
- Inheritance
-
- Object
- Widget
- StatefulWidget
- ProgressList
Constructors
-
ProgressList({required ProgressTracker tracker, Key? key, List<
ProgressColumn> columns = defaultColumns, bool hideFinished = false, int? maxVisible, SpinnerFrames? spinner, ProgressBarShape barShape = ProgressBarShape.blocks, int? maxBarWidth, ByteUnits byteUnits = ByteUnits.decimal}) -
Shows the tasks of
trackerincolumns.const
Properties
- barShape → ProgressBarShape
-
How the bar column is drawn: blocks, or a thinner line.
final
- byteUnits → ByteUnits
-
How the amounts and rates of tasks in ProgressUnit.bytes are
counted and named: by 1000 (
1.2 MB/s), or by 1024 asls -hdoes (1.1 MiB/s).final -
columns
→ List<
ProgressColumn> -
What a row shows, in order; a column given twice is shown once.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hideFinished → bool
-
Whether the tasks done or skipped are left out.
final
- key → Key?
-
Tells this widget apart from its siblings; see Key.
finalinherited
- maxBarWidth → int?
-
How wide the bar column is at most, the room past it left blank at
the right of the rows; null for all the room the other columns leave.
final
- maxVisible → int?
-
How many rows of tasks it shows at most, a row more saying how many
it does not; null for all of them.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spinner → SpinnerFrames?
-
What a running task's mark shows in turn, and how often the rows of
running tasks are painted again; null for Glyphs.spinner of the
theme.
final
- tracker → ProgressTracker
-
What it shows the tasks of.
final
Methods
-
createElement(
) → StatefulElement -
Inflates this widget into a new element for the tree.
inherited
-
createState(
) → State< ProgressList> -
Creates the state of a new element; it lives as long as the element.
override
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Adds what describes this widget in its element's description
(Element.describe) to
properties, those not worth showing (a default) left out; an override calls this first. A render object widget adds only what its render object does not show. Only Element.describe calls it: a frame never does.inherited -
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
Constants
-
defaultColumns
→ const List<
ProgressColumn> - The columns a list shows by default: the mark, the label, the bar, the percent, the rate and the time left.