flutter_custom_pagination 0.1.0
flutter_custom_pagination: ^0.1.0 copied to clipboard
A simple package to help you paginate your data, in web and mobile.
Flutter Custom Pagination #
A simple package to help you paginate your data, in web and mobile. This custom pagination is created due to inflexibility of the Flutter's paginated data table.
Current look and feel are based on Material Design. Feel to contribute to this package to enhance the look and feel of the pagination.
Screenshot image #

Getting Started #
Add this plugin:
dependencies:
flutter_custom_pagination: ^0.1.0
Usage #
import 'package:flutter_custom_pagination/flutter_custom_pagination.dart';
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlutterCustomPagination(
currentPage: currentPage,
limitPerPage: currentPageLimit,
totalDataCount: totalDataCount,
onPreviousPage: _onChangePage,
onBackToFirstPage: _onChangePage,
onNextPage: _onChangePage,
onGoToLastPage: _onChangePage,
backgroundColor: Theme.of(context).colorScheme.background,
textStyle: Theme.of(context).textTheme.labelMedium,
showPageLimitOptions: true,
pageLimitOptions: pageLimitOptions,
onPageLimitChanged: _onPageLimitChanged,
previousPageIcon: Icons.keyboard_arrow_left,
backToFirstPageIcon: Icons.first_page,
nextPageIcon: Icons.keyboard_arrow_right,
goToLastPageIcon: Icons.last_page,
),
);
}
Parameters #
| Name | Type | Description |
|---|---|---|
| currentPage | int | The current page number |
| limitPerPage | int | The limit of data per page |
| totalDataCount | int | The total data count |
| onPreviousPage | Function(int) | The function to be called when the previous page button is pressed |
| onBackToFirstPage | Function(int) | The function to be called when the back to first page button is pressed |
| onNextPage | Function(int) | The function to be called when the next page button is pressed |
| onGoToLastPage | Function(int) | The function to be called when the go to last page button is pressed |
| backgroundColor | Color | The background color of the pagination |
| textStyle | TextStyle | The text style of the pagination |
| showPageLimitOptions | bool | Whether to show the page limit options |
| pageLimitOptions | List | The page limit options |
| onPageLimitChanged | Function(int) | The function to be called when the page limit is changed |
| previousPageIcon | IconData | The icon of the previous page button |
| backToFirstPageIcon | IconData | The icon of the back to first page button |
| nextPageIcon | IconData | The icon of the next page button |
| goToLastPageIcon | IconData | The icon of the go to last page button |