cursor_pagination 1.0.0 copy "cursor_pagination: ^1.0.0" to clipboard
cursor_pagination: ^1.0.0 copied to clipboard

A flexible cursor-based pagination library for Flutter with full generic type support. Works with ChangeNotifier, BLoC/Cubit, and supports any cursor type.

1.0.0 #

Initial Release ๐ŸŽ‰ #

  • โœจ Full generic type support for cursors (String, int, DateTime, custom types)
  • ๐Ÿ”„ Two controller implementations:
    • FlutterPaginationController for ChangeNotifier-based apps
    • CubitPaginationController for BLoC/Cubit pattern
  • ๐Ÿ“œ Auto-loading pagination on scroll
  • ๐ŸŽจ Three distinct states: Data, Empty, and Error
  • ๐Ÿ› ๏ธ Item manipulation methods (update/remove)
  • ๐Ÿ“Š Processing state tracking with isProcessing notifier
  • ๐ŸŽฏ Type-safe error handling
  • ๐Ÿ“š Comprehensive documentation and examples
  • ๐Ÿงช Production-ready implementation

Features #

  • Flexible Cursor Types: Use any type as cursor (String, int, DateTime, or custom)
  • State Management: Works with both ChangeNotifier and BLoC patterns
  • Smart Auto-loading: Automatically loads next page when scrolling near bottom (200px threshold)
  • Item Operations: Update or remove items without refetching entire list
  • Error Handling: Type-safe error handling with custom error types
  • Loading State: Built-in processing state for UI feedback
  • Refresh Support: Pull-to-refresh and manual refresh capabilities
  • Widget Builder: CubitPaginatedListBuilder for easy BLoC integration

API #

Core Classes

  • CursorPagination<T> - Generic pagination state
  • PaginationResult<ItemType, CursorType, ErrorType> - Result wrapper
  • PaginationControllerState<ItemType, CursorType, ErrorType> - Controller state
  • FlutterPaginationController<ItemType, CursorType, ErrorType> - ChangeNotifier controller
  • CubitPaginationController<ItemType, CursorType, ErrorType> - BLoC/Cubit controller
  • CubitPaginatedListBuilder<ItemType, CursorType, ErrorType> - Widget builder for BLoC

Methods

  • getFirst() - Load first page
  • getNext() - Load next page
  • refreshCurrent() - Refresh current page
  • updateItemAt(index, item) - Update specific item
  • removeItemAt(index) - Remove specific item

Dependencies #

  • flutter: sdk
  • flutter_bloc: ^8.1.0

Migration Guide #

This is the initial release, no migration needed.

5
likes
150
points
59
downloads

Publisher

unverified uploader

Weekly Downloads

A flexible cursor-based pagination library for Flutter with full generic type support. Works with ChangeNotifier, BLoC/Cubit, and supports any cursor type.

Repository (GitHub)
View/report issues

Topics

#pagination #cursor #infinite-scroll #flutter #bloc

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter, flutter_bloc

More

Packages that depend on cursor_pagination