All Projects → MaikuB → incrementally_loading_listview

MaikuB / incrementally_loading_listview

Licence: BSD-3-Clause license
An extension of the Flutter ListView widget for incrementally loading items upon scrolling

Programming Languages

dart
5743 projects
ruby
36898 projects - #4 most used programming language
kotlin
9241 projects
swift
15916 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to incrementally loading listview

Motion-Tab-Bar
A beautiful animated flutter widget package library. The tab bar will attempt to use your current theme out of the box, however you may want to theme it.
Stars: ✭ 237 (+37.79%)
Mutual labels:  widget, flutter-widget, flutter-package
flutter easyloading
✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web
Stars: ✭ 1,021 (+493.6%)
Mutual labels:  widget, flutter-widget, flutter-package
text-style-editor
Text style editor widget for flutter
Stars: ✭ 25 (-85.47%)
Mutual labels:  widget, flutter-widget
getwidget-docs
Get Widgets UI library docs.
Stars: ✭ 17 (-90.12%)
Mutual labels:  flutter-widget, flutter-package
sounds
Flutter plugin for sound. Audio recorder and player.
Stars: ✭ 74 (-56.98%)
Mutual labels:  widget, flutter-package
nil
A simple Flutter widget to add in the widget tree when you want to show nothing, with minimal impact on performance.
Stars: ✭ 130 (-24.42%)
Mutual labels:  flutter-widget, flutter-package
barcode.flutter
barcode generate library for Flutter
Stars: ✭ 58 (-66.28%)
Mutual labels:  flutter-widget, flutter-package
seo renderer
A Flutter Web Plugin to display Text Widget as Html for SEO purpose
Stars: ✭ 103 (-40.12%)
Mutual labels:  flutter-widget, flutter-package
feedback
A simple widget for getting better feedback.
Stars: ✭ 178 (+3.49%)
Mutual labels:  widget, flutter-package
instagram-text-editor
An Instagram like text editor Flutter widget that helps you to change your text style.
Stars: ✭ 66 (-61.63%)
Mutual labels:  widget, flutter-widget
dough
This package provides some widgets you can use to create a smooshy UI.
Stars: ✭ 518 (+201.16%)
Mutual labels:  flutter-widget, flutter-package
bottom animation
Bottom Navigation Mixed Animation
Stars: ✭ 32 (-81.4%)
Mutual labels:  flutter-widget, flutter-package
flutter sliding tutorial
User onboarding library with smooth animation of objects and background colors
Stars: ✭ 127 (-26.16%)
Mutual labels:  flutter-widget, flutter-package
flutter json view
📄 Displaying json models in a Flutter widget
Stars: ✭ 28 (-83.72%)
Mutual labels:  widget, flutter-widget
FlutterLoadingGIFs
Loading indicator GIFs. Material and Cupertino (Android and iOS) loading indicators in assorted sizes. Use as placeholders for loading remote image assets. Demo: https://gallery.codelessly.com/flutterwebsites/loadinggifs/
Stars: ✭ 28 (-83.72%)
Mutual labels:  flutter-widget, flutter-package
flutter-app
Full Feature Todos Flutter Mobile app with fireStore integration.
Stars: ✭ 138 (-19.77%)
Mutual labels:  flutter-widget, flutter-package
file manager
FileManager is a wonderful widget that allows you to manage files and folders, pick files and folders, and do a lot more. Designed to feel like part of the Flutter framework.
Stars: ✭ 38 (-77.91%)
Mutual labels:  widget, flutter-package
backdrop
Backdrop implementation in flutter.
Stars: ✭ 203 (+18.02%)
Mutual labels:  widget, flutter-widget
flutter scatter
A widget that displays a collection of dispersed and non-overlapping children
Stars: ✭ 85 (-50.58%)
Mutual labels:  flutter-widget, flutter-package
liquid button
Liquify your buttons, web demo at website
Stars: ✭ 18 (-89.53%)
Mutual labels:  flutter-widget, flutter-package

incrementally_loading_listview

pub package

An extension of the Flutter ListView widget for incrementally loading items upon scrolling. This could be used to load paginated data received from API requests.

NOTE: this package depends on rxdart. If you run into conflicts with different versions of rxdart, consider using dependency overrides as per this link

Getting Started

There's a working example that can be run to see how it works.

First import the library

import 'package:incrementally_loading_listview/incrementally_loading_listview.dart';

You can then use the IncrementallyLoadingListView widget in a similar way you would with the ListView.separated constructor

return IncrementallyLoadingListView(
    hasMore: () => _hasMoreItems,
    itemCount: () => items.length,
    loadMore: () async {
        // can shorten to "loadMore: _loadMoreItems" but this syntax is used to demonstrate that
        // functions with parameters can also be invoked if needed
        await _loadMoreItems();
    },
    loadMoreOffsetFromBottom: 2,
    itemBuilder: (context, index) {
        /// your builder function for rendering the item
    },
    separatorBuilder: (context, index) {
        /// your builder function for rendering the separator
    }
);

The widget allows passing in the same parameters you would to the ListView.builder constructor but itemCount is required so that when an item scrolls into view, it can see if it should attempt to load more items. Note that this is a callback that returns a boolean rather than being a boolean value. This allows the widget to not require a reference/copy of your data collection. The other parameters that can be specified are

  • hasMore: a callback that indicates if there are more items that can be loaded
  • loadMore: a callback to an asynchronous function that loads more items
  • loadMoreOffsetFromBottom: determines when the list view should attempt to load more items based on of the index of the item is scrolling into view. This is relative to the bottom of the list and has a default value of 0 so that it loads when the last item within the list view scrolls into view. As an example, setting this to 1 would attempt to load more items when the second last item within the list view scrolls into view
  • onLoadMore: a callback that is triggered when more items are being loaded. At first this will pass a boolean value of true to when items are being loaded by triggering the loadMore callback function. You could use this to update your UI to show a loading indicator
  • onLoadMoreFinished: a callback that is triggered when items have finished being loading. You can use this to hide your loading indicator
  • separatorBuilder: not required builder function that place separator between items

Providing onLoadMore and onLoadMoreFinished callbacks means the widget doesn't make assumptions on how you want to render a loading indicator so it will be up to your application to handle these callbacks to render the appropriate UI.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].