Circular progress
A circular indicator fits a wait in a small space. Use an indeterminate spinner when a task is running and its completion time is unknown.
Sync a folder
#Start the folder sync. The example keeps it running until you choose Finish sync, so you can inspect the spinner at either text size.
components/circular-progress/appliance/sync_folder.dart
import 'package:flutter/widgets.dart';
import 'package:appliance_ui/appliance_ui.dart';
class SyncFolder extends StatefulWidget {
const SyncFolder({super.key});
@override
State<SyncFolder> createState() => _SyncFolderState();
}
class _SyncFolderState extends State<SyncFolder> {
bool running = false;
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
spacing: 12,
children: [
if (running) const ApplianceProgressRing(semanticLabel: 'Syncing folder'),
Text(running ? 'Syncing folder' : 'Folder ready'),
ApplianceButton(
running ? 'Finish sync' : 'Start sync',
onPressed: () => setState(() => running = !running),
),
],
);
}
Parameters
ApplianceProgressRing API ↗semanticLabel- Names the operation while it is running.
size- Sets the spinner size.
stroke- Sets the ring’s stroke width.
value- Sets determinate progress when a fraction is known.
Shared behaviour
- Keyboard and focus. Tab to Start sync and press Enter or Space. Activate Finish sync to complete the example.
- Screen readers. Read the current sync status and the button label. Compare how each look names the indicator while it runs.
- Direction and type. The short status sits beside or below the indicator according to the look. Try RTL and large type at phone width.