number_pagination 1.1.6

SDKflutter
Platformandroidioswindowslinuxmacosweb

Pagination using numbers, similar to the classic web-style pagination. Explore pages by numbers, not infinite scrolling!

preview

number_pagination flutter flutter test package

ko-fi

Implementing Flutter Number Pagination using a Popular Web Approach.

This package is very simple. Without depending on other packages.

Its usage is also simple and easy.

document

NumberPagination

A customizable pagination widget for Flutter applications.

Overview

NumberPagination is a Flutter widget that provides an intuitive and flexible way to implement pagination in your applications. It displays page numbers and navigation controls, allowing users to easily navigate through multiple pages of content.

Features

  • Page number buttons
  • Navigation controls (first, previous, next, last)
  • Customizable appearance
  • Responsive design

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  number_pagination: ^1.1.0

Customization Options for NumberPagination Widget

The NumberPagination widget offers a wide range of customization options to tailor its appearance and behavior to your needs. Below is a comprehensive list of these options:

Page Display

OptionTypeDescriptionDefault
visiblePagesCountintNumber of page numbers to display at once10
currentPageintCurrently displayed page numberRequired
totalPagesintTotal number of pages availableRequired

Text Styling

OptionTypeDescriptionDefault
fontSizedoubleFont size for the page numbers15
fontFamilyString?Font family for the page numbersnull

Button Styling

OptionTypeDescriptionDefault
buttonElevationdoubleElevation of the buttons5
buttonRadiusdoubleRadius of the buttons0
controlButtonSizeSizeSize of the control buttonsSize(48, 48)
numberButtonSizeSizeSize of the number buttonsSize(48, 48)

Colors

OptionTypeDescriptionDefault
selectedTextColorColorText color for the selected page buttonColors.white
unSelectedTextColorColorText color for unselected page buttonsColors.black
selectedButtonColorColorBackground color of the selected page buttonColors.black
unSelectedButtonColorColorBackground color of unselected page buttonsColors.white
controlButtonColorColorBackground color of control buttonsColors.white

Icons

OptionTypeDescriptionDefault
firstPageIconWidgetIcon for the "first page" buttonIcon(Icons.first_page)
previousPageIconWidgetIcon for the "previous page" buttonIcon(Icons.keyboard_arrow_left)
nextPageIconWidgetIcon for the "next page" buttonIcon(Icons.keyboard_arrow_right)
lastPageIconWidgetIcon for the "last page" buttonIcon(Icons.last_page)

Spacing

OptionTypeDescriptionDefault
navigationButtonSpacingdoubleSpacing between navigation buttons4.0
sectionSpacingdoubleSpacing between navigation buttons and page number buttons10.0
betweenNumberButtonSpacingdoubleSpacing between individual number buttons3

Callback

OptionTypeDescription
onPageChangedFunction(int)Callback function triggered when the page changes

These customization options allow you to fine-tune the appearance and behavior of the NumberPagination widget to seamlessly integrate with your app's design and functionality.