Page indicator dots
Page dots show a position within a short, fixed sequence. A nearby page name helps distinguish the destinations represented by the marks.
Browse three pages
#Choose a dot to move between Cover, Notes and Credits. The selected mark follows the page title.
components/page-dots/appliance/browse_pages.dart
import 'package:flutter/widgets.dart';
import 'package:appliance_ui/appliance_ui.dart';
class BrowsePages extends StatefulWidget {
const BrowsePages({super.key});
@override
State<BrowsePages> createState() => _BrowsePagesState();
}
class _BrowsePagesState extends State<BrowsePages> {
int page = 0;
static const titles = ['Cover', 'Notes', 'Credits'];
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(titles[page]),
const SizedBox(height: 12),
AppliancePageDots(
count: titles.length,
index: page,
onChanged: (next) => setState(() => page = next),
),
],
);
}
Parameters
AppliancePageDots API ↗count- Total number of pages.
index- Zero-based position of the current page.
onChanged- Receives the position requested by a dot.
Shared behaviour
- Keyboard and focus. Focus the dot controls, move to another position and activate it. Follow the page title to check which position opened.
- Screen readers. Inspect the page labels and selected state, then read the current page title.
- Direction and type. Switch to RTL to inspect the first and last dots. In larger type, compare the fixed marks with the page title.