Search packages, repositories and app categories

Package detailsv1.0.7

loadmore_listview

Provide an easy-to-use Listview with load more items and refresh function

AndroidiOSmacOSWindowsLinux
30-day downloads
1.5K
Likes
25
Pub points
140

Install package

flutter pub add loadmore_listview

Package Overview

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

A Flutter package that simplifies the implementation of a ListView with infinite scrolling and pull-to-refresh functionality. It provides a clean, easy-to-use interface for loading additional items as users scroll, reducing boilerplate code. The package supports multiple platforms including Android, iOS, macOS, Windows, and Linux, making it ideal for cross-platform applications. Built with Dart, it integrates seamlessly into existing Flutter projects.

Use cases

  • Infinite scrolling feeds
  • Pull-to-refresh data lists
  • E-commerce product listings
  • Social media timelines
  • News feed applications

Key features

  • Built-in pull-to-refresh
  • Automatic load more on scroll
  • Customizable loading indicators
  • Supports null safety
  • Cross-platform compatibility

Suitable for

  • Developers seeking simple pagination
  • Apps with dynamic content
  • Projects requiring smooth scrolling
  • Beginners learning Flutter
  • Apps with large datasets

Considerations

  • Requires proper error handling for network requests
  • May need custom logic for complex loading conditions
  • Not suitable for static lists
  • Limited customization for advanced UI needs
  • Depends on external state management for data sources

Original README

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

Load More Listview

An Widget with the Load more item and refresh

Base on ListView and CustomScrollListview

LoadMoreListView.builder

Getting Started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  loadmore_listview: ^1.0.7

Import it:

import 'package:loadmore_listview/loadmore_listview.dart';

Usage Examples

LoadMoreListView.builder
LoadMoreListView.builder(
    //is there more data to load
    haveMoreItem: true,
    //Trigger the bottom loadMore callback
    onLoadMore: () async{
      //wait for your api to fetch more items
      await Future.delayed(const Duration(seconds: 1));
    },
    //pull down refresh callback
    onRefresh: () async{
      //wait for your api to update the list
      await Future.delayed(const Duration(seconds: 1));
    },
    //you can set your loadMore Animation
    loadMoreWidget: Container(
        margin: const EdgeInsets.all(20.0),
        alignment: Alignment.center,
        child: const CircularProgressIndicator(
          valueColor: AlwaysStoppedAnimation(Colors.blueAccent),
        ),
    ),
    //ListView
    itemCount: 20,
    itemBuilder: (context, index) {
        return Container(
            margin: const EdgeInsets.all(30),
            width: double.infinity,
            alignment: Alignment.center,
            child: Text('$index'),
        );
    },
);
LoadMoreListView.separated
LoadMoreListView.separated(
    //...
    separatorBuilder: (context, index) {
      return const Divider();
    },
);
LoadMoreListView.customScrollView
LoadMoreListView.customScrollView(
    //...
    slivers: [
        SliverList(
            delegate: SliverChildBuilderDelegate(
              (context, index) {
                return Container(
                  margin: const EdgeInsets.all(30),
                  width: double.infinity,
                  alignment: Alignment.center,
                  child: Text(list[index]),
                );
              },
              childCount: list.length,
            ),
        ),
    ],
);

Categories

Source repository

Projects using this package

No data available yet.