Protected against bots by Yandex SmartCaptcha. Data processing policy
Progress indicators
Show that something is going on: a spinning ring, a progress bar and "pull to refresh". Without
value
an indicator is
indeterminate
(it spins or runs); with
value
from 0 to 1 it shows a fraction. The iOS-style indicator is
`CupertinoActivityIndicator`
.
CircularProgressIndicator
A Material circular indicator.
Type:
leaf
CircularProgressIndicator
| Parameter | Type | Default | Description |
|---|---|---|---|
value
|
double | — | Fraction from 0 to 1. Without it the indicator spins |
color
|
color | from theme | Ring color |
strokeWidth
|
double | 4 | Ring thickness |
size
|
double | — | Side of the square the ring is fitted into. Without it — the Flutter default size (36 on the site) |
CircularProgressIndicator color:#4f46e5 strokeWidth:3 size:28
LinearProgressIndicator
A Material horizontal progress bar, as wide as its parent.
Type:
leaf
LinearProgressIndicator value:0.7 color:#4f46e5 backgroundColor:#e2e8f0
| Parameter | Type | Default | Description |
|---|---|---|---|
value
|
double | — | Fraction from 0 to 1. Without it the bar runs |
color
|
color | from theme | Color of the filled part |
backgroundColor
|
color | from theme | Track color |
minHeight
|
double | 4 | Bar thickness |
#borderRadius
|
structure | — |
Rounding:
#borderRadius circular 4
|
Loading and progress
Padding
#padding all 24
Column spacing:24
LinearProgressIndicator
LinearProgressIndicator value:0.65 color:#4f46e5 backgroundColor:#e2e8f0 minHeight:8
#borderRadius circular 4
RefreshIndicator
Pull-to-refresh around a scrollable child. When the list is pulled past its top edge, a ring appears and
onRefresh
is called.
Type:
single-child
@reloads:0
RefreshIndicator onRefresh:(){reloads = reloads + 1}
SingleChildScrollView
Column
Text "Pull down"
| Parameter | Type | Default | Description |
|---|---|---|---|
onRefresh
|
callback | — | What to do on refresh |
color
|
color | from theme | Ring color |
backgroundColor
|
color | from theme | Background of the circle with the ring |
displacement
|
double | 40 | How far the ring drops from the top edge |
edgeOffset
|
double | 0 | Offset of the point where it appears (for example, below a header) |
strokeWidth
|
double | 2.5 | Ring thickness |
The child must scroll (
SingleChildScrollView
,
ListView
…): the gesture is caught through scrolling.
onRefresh
is called and immediately treated as finished — the ring disappears without waiting for loading.
Differences between the app and the site
-
CircularProgressIndicatoris currently not visible on the site: the ring is not drawn, and the element stretches to the full width;size,strokeWidthandbackgroundColordo not fix this.valueis not read either — the fraction is not shown. -
LinearProgressIndicatoris drawn on the site both with a fraction and as a running bar;minHeight,#borderRadiusand the colors are read. The value is taken once, when the page is built :value:$pdoes not follow the variable, and the bar does not move whenpchanges. -
RefreshIndicatordoes nothing on the site: only the child is drawn, there is no gesture and noonRefresh. - Indeterminate indicators keep moving on the site even when animations are turned off in the system — otherwise a stopped indicator reads as something broken.
See also
-
iOS-style elements
—
CupertinoActivityIndicator -
SingleChildScrollView
,
ListView
— the child of
RefreshIndicator