Tinyrack

Pagination

Navigate static Flutter result pages with a compact, derived number range.

Navigate static result pages with a compact, derived number range.

Contract

AxisContract
RangeboundaryCount, siblingCount
Current pageClamped to 1...totalPages

Install

Add the package, then import its public library.

flutter pub add tinyrack_ui
import 'package:tinyrack_ui/tinyrack_ui.dart';

Playground

Usage

import 'package:material_ui/material_ui.dart';
import 'package:tinyrack_ui/tinyrack_ui.dart';

TRPagination(
  currentPage: page,
  totalPages: 12,
  onPageChanged: setPage,
)

Examples

Control the current page permalink

Keep page state in the parent and tune the derived range without rebuilding pagination items.

API

TRPagination properties

PropType / defaultPurpose
currentPageint · requiredSelects the current page.
totalPagesint · requiredSets the available page count.
onPageChangedValueChanged<int> · requiredReceives page activations.
boundaryCount / siblingCountint · 1Controls pinned and adjacent pages.