Search packages, repositories and app categories

Package detailsv2.0.2

infinite_widgets

Infinite layout widgets, allow you to easily create infinite list or infinite grid from database or network calls.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
584
Likes
19
Pub points
140

Install package

flutter pub add infinite_widgets

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

InfiniteWidgets is a Flutter package that simplifies the creation of infinite scrollable lists and grids, ideal for loading data from databases or network sources incrementally. It provides layout widgets that handle pagination logic seamlessly, reducing boilerplate code. Designed for performance, it efficiently loads items on demand, making it perfect for large datasets. The package supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux.

Use cases

  • Loading large datasets from APIs
  • Creating infinite scrolling feeds
  • Building dynamic grids with lazy loading
  • Implementing paginated content in apps
  • Displaying real-time data streams

Key features

  • Efficient lazy loading
  • Support for infinite lists and grids
  • Built-in pagination handling
  • Cross-platform compatibility
  • Minimal boilerplate code
  • Smooth user experience

Suitable for

  • Apps with large data sets
  • Social media feeds
  • E-commerce product listings
  • Real-time data displays
  • Developers seeking simple pagination

Considerations

  • Requires proper state management
  • May need custom error handling
  • Best suited for continuous data streams
  • Not ideal for small static lists
  • Performance depends on data source efficiency

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

infinite_widgets

Infinite layout widgets like lists, grids...

Infinite list

InfiniteListView has same attributes as a normal flutter ListView widget.

InfiniteListView.separated(
        itemBuilder: (context, index) {
          return Text('$index', style: TextStyle(color: Colors.red, fontWeight: FontWeight.bold));
        },
        itemCount: _data.length, // Current itemCount you have
        hasNext: _data.length < 200, // let the widget know if you have more data to show or not
        nextData: this.loadNextData, // callback called when end to the list is reach and hasNext is true
        separatorBuilder: (context, index) => Divider(height: 1),
      ),
    );

You can specify the last loading row by providing loadingWidget.

You can interact with the trigger to load additional data by default it's 300 but you can override it with scrollThreshold.

Infinite grid

InfiniteGridView has same attributes as a normal flutter GridView widget.

InfiniteGridView(
        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
        itemBuilder: (context, index) {
          return Text('$index', style: TextStyle(color: Colors.white));
        },
        itemCount: _data.length, // Current itemCount you have
        hasNext: _data.length < 200, // let the widget know if you have more data to show or not
        nextData: this.loadNextData, // callback called when end to the list is reach and hasNext is true
      ),
    );

You can specify the last loading row by providing loadingWidget.

You can interact with the trigger to load additional data by default it's 300 but you can override it with scrollThreshold.

Categories

Source repository

Projects using this package

No data available yet.