infinite_scroller library

A high-performance, infinitely scrolling horizontal grid widget for Flutter.

This library provides a customizable infinite scroller with synchronized tabs, perfect for e-commerce apps, media galleries, and grouped content.

Quick Example

import 'package:infinite_scroller/infinite_scroller.dart';

InfiniteScroller<Product>(
  sections: [
    ScrollerSection(label: 'Electronics', items: electronicsItems),
    ScrollerSection(label: 'Clothing', items: clothingItems),
  ],
  tabBuilder: (context, section, index, isActive) {
    return Tab(label: section.label, isActive: isActive);
  },
  itemBuilder: (context, section, item, itemIndex, globalIndex) {
    return ProductCard(product: item);
  },
)

Classes

GridConfig
Configuration for the content grid layout and scroll behavior.
HapticConfig
Configuration for haptic feedback on user interactions.
InfiniteScroller<T>
A high-performance infinite horizontal scroller with synchronized tabs.
ScrollerController
Controller for programmatic control and state access of InfiniteScroller.
ScrollerSection<T>
Represents a section/group containing items for the infinite scroller.
TabBarConfig
Configuration for the tab bar appearance and behavior.

Enums

HapticType
Types of haptic feedback intensity.
TabBarPosition
Position of the tab bar relative to the grid content.

Typedefs

ItemBuilder<T> = Widget Function(BuildContext context, ScrollerSection<T> section, T item, int itemIndex, int globalIndex)
Builder function for creating item widgets in the grid.
OnItemTap<T> = void Function(T item, int sectionIndex, int itemIndex)
Callback fired when an item is tapped.
OnScroll = void Function(double offset, double maxExtent)
Callback fired continuously during scroll.
OnSectionChanged = void Function(int index, String? sectionId)
Callback fired when the active section changes during scroll or tap.
OnTabDoubleTap<T> = void Function(ScrollerSection<T> section, int index)
Callback fired when a tab is double-tapped.
OnTabLongPress<T> = void Function(ScrollerSection<T> section, int index)
Callback fired when a tab is long-pressed.
SeparatorBuilder<T> = Widget? Function(BuildContext context, ScrollerSection<T> section, int sectionIndex)
Builder function for creating separators between sections.
TabBuilder<T> = Widget Function(BuildContext context, ScrollerSection<T> section, int index, bool isActive)
Builder function for creating section tab widgets.