NumberPagination class

A customizable pagination widget that displays page numbers and navigation controls.

This widget allows users to navigate through pages using numbered buttons and control buttons (first, previous, next, last). It's highly customizable in terms of appearance and behavior.

Inheritance

Constructors

NumberPagination({Key? key, required dynamic onPageChanged(int), required int totalPages, required int currentPage, int visiblePagesCount = 10, double fontSize = 15, String? fontFamily, double buttonElevation = 5, double buttonRadius = 0, Widget firstPageIcon = const Icon(Icons.first_page), Widget previousPageIcon = const Icon(Icons.keyboard_arrow_left), Widget nextPageIcon = const Icon(Icons.keyboard_arrow_right), Widget lastPageIcon = const Icon(Icons.last_page), double navigationButtonSpacing = 4.0, double sectionSpacing = 10.0, Size controlButtonSize = const Size(48, 48), Size numberButtonSize = const Size(48, 48), double betweenNumberButtonSpacing = 3, Color selectedNumberColor = Colors.white, Color unSelectedNumberColor = Colors.black, Color selectedButtonColor = Colors.black, Color unSelectedButtonColor = Colors.white, Color controlButtonColor = Colors.white, FontWeight selectedNumberFontWeight = FontWeight.w600})
Creates a NumberPagination widget.
const

Properties

betweenNumberButtonSpacing double
Spacing between individual number buttons.
final
buttonElevation double
Elevation of the buttons.
final
buttonRadius double
Radius of the buttons.
final
controlButtonColor Color
The background color of control buttons.
final
controlButtonSize Size
Size of the control buttons.
final
currentPage int
Currently displayed page number.
final
firstPageIcon Widget
Icon for the "first page" button.
final
fontFamily String?
Font family for the page numbers.
final
fontSize double
Font size for the page numbers.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lastPageIcon Widget
Icon for the "last page" button.
final
Spacing between navigation buttons.
final
nextPageIcon Widget
Icon for the "next page" button.
final
numberButtonSize Size
Size of the number buttons.
final
onPageChanged → dynamic Function(int)
Callback function triggered when the page changes.
final
previousPageIcon Widget
Icon for the "previous page" button.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sectionSpacing double
Spacing between navigation buttons and page number buttons.
final
selectedButtonColor Color
The background color of the selected page button.
final
selectedNumberColor Color
The color of the text for the selected page button.
final
selectedNumberFontWeight FontWeight
The font weight of the selected page number.
final
totalPages int
Total number of pages available.
final
unSelectedButtonColor Color
The background color of unselected page buttons.
final
unSelectedNumberColor Color
The color of the text for unselected page buttons.
final
visiblePagesCount int
Number of page buttons to display at once.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited