Paginator class
A pagination dots indicator widget (e.g. ○ ○ ● ○ ○).
It renders a row of dot indicators representing pages, highlighting the currently active page dot with activeStyle and activeDot, and others with inactiveStyle and inactiveDot.
Example Usage
Paginator(
totalPages: 5,
currentPage: 2,
activeDot: '★',
inactiveDot: '☆',
);
Properties and Settings
| Property | Type | Description |
|---|---|---|
totalPages |
int | The total number of pages to display dots for. |
currentPage |
int | The zero-indexed current active page. |
activeStyle |
Style | Style applied to the active dot. |
inactiveStyle |
Style | Style applied to inactive dots (defaults to dim). |
separatorStyle |
Style | Style applied to separators (defaults to dim). |
activeDot |
String | Grapheme representing the active page dot. Defaults to ●. |
inactiveDot |
String | Grapheme representing inactive page dots. Defaults to •. |
separator |
String | Spacer separator text between dots. Defaults to . |
Constructors
- Paginator({required int totalPages, required int currentPage, Style activeStyle = Style.empty, Style inactiveStyle = const Style(modifiers: Modifier.dim), Style separatorStyle = const Style(modifiers: Modifier.dim), String activeDot = '●', String inactiveDot = '•', String separator = ' '})
-
Creates a Paginator widget.
const
Properties
- activeDot → String
-
Grapheme representing the active page dot. Defaults to
●.final - activeStyle → Style
-
Style applied to the active dot.
final
- currentPage → int
-
The zero-indexed current active page.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- inactiveDot → String
-
Grapheme representing inactive page dots. Defaults to
•.final - inactiveStyle → Style
-
Style applied to inactive dots (defaults to dim).
final
- key → Key?
-
The optional key for this widget.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- separator → String
-
Spacer separator text between dots. Defaults to
.final - separatorStyle → Style
-
Style applied to separators (defaults to dim).
final
- totalPages → int
-
The total number of pages to display dots for.
final
Methods
-
createElement(
) → Element -
Creates an Element to manage this widget's location in the tree.
inherited
-
getIntrinsicHeight(
int width) → int -
Computes the intrinsic height of this widget under the given
widthconstraint.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
Buffer buffer, Rect area) → void -
Renders the widget onto the provided
bufferwithin the specifiedarea.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited