hexsis_infinity_scroll 0.2.3 copy "hexsis_infinity_scroll: ^0.2.3" to clipboard
hexsis_infinity_scroll: ^0.2.3 copied to clipboard

Production-ready infinite scroll package for Flutter with zero dependencies. Supports ListView, GridView, and Sliver widgets with built-in loading, error, and empty states.

0.2.3 #

  • FEAT: Update package versions and enhance documentation for reliability and lifecycle management.
  • FEAT: Add comprehensive tests for infinite scroll functionality across various implementations.
  • FEAT: Add disposal checks to infinite scroll controllers and notifiers to prevent operations after disposal.
  • FEAT: Enhance infinite scroll functionality with detailed documentation and improved state management.

0.2.2 #

Breaking Changes (Sliver Widgets Only):

  • InfiniteScrollSliverList now requires scrollController parameter
  • InfiniteScrollSliverGrid now requires scrollController parameter
  • Pass the same ScrollController used in parent CustomScrollView

Reason: Ensures reliable scroll detection in CustomScrollView

Migration Guide:

// Before (didn't work):
CustomScrollView(
  slivers: [
    InfiniteScrollSliverList<Product>(
      simpleFetcher: ...,
      itemBuilder: ...,
    ),
  ],
)

// After (works perfectly):
class MyScreen extends StatefulWidget {
  @override
  State createState() => _State();
}

class _State extends State<MyScreen> {
  late ScrollController _controller;
  
  @override
  void initState() {
    super.initState();
    _controller = ScrollController();
  }
  
  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }
  
  @override
  Widget build(BuildContext context) {
    return CustomScrollView(
      controller: _controller,
      slivers: [
        InfiniteScrollSliverList<Product>(
          scrollController: _controller,  // Required!
          simpleFetcher: ...,
          itemBuilder: ...,
        ),
      ],
    );
  }
}

Note: ListView/GridView widgets unchanged - still zero boilerplate!

Improvements:

  • Smart threshold now works in sliver widgets
  • Debouncing works correctly
  • All loading states handled

0.2.1 #

Improvements:

  • Smart threshold logic - Prevents premature loading in long lists
  • For small lists (<5000px): Uses percentage threshold (default 80%)
  • For large lists (≥5000px): Uses fixed pixel offset (default 500px from bottom)
  • New config options: thresholdPixels, thresholdBreakpoint, useSmartThreshold
  • Backwards compatible - smart threshold enabled by default
  • Consistent loading behavior regardless of list size

Example:

  • List with 1000px: Loads at 800px (200px from bottom)
  • List with 10000px: Loads at 9500px (500px from bottom) - No longer loads 2000px early!

0.2.0 #

MAJOR REFACTORING - Now zero-dependency core package

Breaking Changes:

  • Package split into 4 separate packages (core + 3 extensions)
  • Simplified fetcher API: 3 levels (Simple, Tuple, Full)
  • Built-in widgets replace manual ListView building
  • Removed BLoC/Riverpod/Hooks dependencies from core

New Features:

  • Zero dependencies - Only Flutter SDK required
  • InfiniteScrollListView - Built-in ListView with all states
  • InfiniteScrollGridView - Built-in GridView support
  • InfiniteScrollSliverList - Sliver support for CustomScrollView
  • InfiniteScrollSliverGrid - Sliver grid support
  • Default UI components - Loading, error, empty state widgets
  • SimpleFetcher - Auto-detect pagination from List length
  • TupleFetcher - Control hasMore manually
  • Reduced boilerplate - 92% less code for users
  • pageSize config - For auto-detection logic

Migration from 0.1.0:

// Before
final controller = InfiniteScrollController<Product>(
  fetcher: (page) async => PaginatedData(...),
);
ListView.builder(controller: controller.scrollController, ...);

// After
InfiniteScrollListView<Product>(
  simpleFetcher: (page) async => await api.getProducts(page),
  itemBuilder: (context, item, index) => ProductCard(item),
);

0.1.0 #

  • Controller-based architecture with Riverpod/BLoC/Cubit support
  • Hooks wrappers for convenient API
  • 21 comprehensive unit tests

0.0.1 #

  • Initial release with controller-based architecture
0
likes
160
points
580
downloads

Documentation

API reference

Publisher

verified publisherhexsis.com

Weekly Downloads

Production-ready infinite scroll package for Flutter with zero dependencies. Supports ListView, GridView, and Sliver widgets with built-in loading, error, and empty states.

Homepage

License

MIT (license)

Dependencies

flutter

More

Packages that depend on hexsis_infinity_scroll