Flutter Infinite ListView - ListView with items that can be scrolled infinitely in both directions. Maintainer: @slightfoot

Overview

Flutter Community: infinite_listview

Flutter Infinite ListView

pub package

ListView with items that can be scrolled infinitely in both directions.

Quick Usage

Replace your existing ListView with InfiniteListView. Builder pattern must be used because of its infinite nature.

Example

Example

Bugs/Requests

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on Github and I'll look into it. Pull Request are also welcome.

Comments
  • Possible to use in a CustomScrollView with SliverAppBar

    Possible to use in a CustomScrollView with SliverAppBar

    Hi!

    I want to put an InifiniteListView inside a CustomScrollView so that I can get an appbar that will go in and out of view but I think to have a list inside the scroll view, it needs to be a SliverList or at least extend SliverMultiBoxAdaptorWidget

    opened by Nolence 4
  • What is this for?

    What is this for?

    From the example and README I see no reason why someone should use this instead of a regular ListView.builder.

    Could you please clarify what usecases are there for this?

    Thanks!

    question 
    opened by lifenautjoe 3
  • How to specify limits at runtime?

    How to specify limits at runtime?

    Apologies if this is too obvious, but how does one handle a situation where we do not know the total number of items, so we keep scrolling up (or down) until the remote REST server returns no-more-data?

    All the sample code I have seen so far is truly infinite, without any upper or lower limits.

    How do we set the limits at the time of fetching new data? Thanks.

    opened by renjipanicker 2
  • Infinite listview not listening to NeverScrollableScrollPhysics

    Infinite listview not listening to NeverScrollableScrollPhysics

    This will not prevent the InfiniteListView from scrolling which is not the expected behaviour: InfiniteListView.builder(physics: NeverScrollableScrollPhysics())

    opened by rubenvde 2
  • Preventing negative index?

    Preventing negative index?

    Thank you for this great package!

    I have implemented it for an Android TV app in a vertical set of horizontal rows, forming a grid.

    The issue I am finding is that focus lets me scroll horizontally from the '0' index to the left, so I am getting to a negative index (-1), and I get a blank space in the row.

    How could I prevent focus going to this negative index? Thanks!

    opened by hansolowireless 1
  • Infinite scrolling but only in one direction

    Infinite scrolling but only in one direction

    Is there anyway to prevent the scrollview from going into negative numbers? I want it to scroll infinitely positively, but not negatively?

    So infinite scrolling but only in one direction

    opened by MobileMon 1
  • Could you please make `_InfiniteScrollPosition`

    Could you please make `_InfiniteScrollPosition` "global" (`InfiniteScollPosition`)?

    In a conjunction with a linked_scroll_controller we could have made a linked_infinite_scroll_controller, but that isn't possible when we don't have access to InfiniteScrollPosition

    opened by RoarGronmo 0
  • Add snaping functionality

    Add snaping functionality

    We needed this functionality in one of our apps, so I implemented it into this package. It's up to the maintainers to decide if this is suitable for their package, but I thought that I might as well open a pull request since I had to make this anyway.

    To make the list snap, I created a new named constructor, InfiniteListView.snapping. The reason for creating a new constructor is that this feature does not work with separators, and itemExtent needs to be non-null. I could have asserted that itemExtent is not null when snap is true in the InfiniteListView.builder constructor, but I think that that approach is less clear an more prone to errors.

    When snap is set to true in the constructor, the list will animate to the closest child in the scroll direction when the delta between the two latest scroll events is below snapTreshold and run the onSnap callback.

    I have edited the example app to show this feature in action.

    opened by Hannnes1 0
  • How to remove the white space when the list reach out to the last item

    How to remove the white space when the list reach out to the last item

    Problem: there is a large white space when the listview reaches out to the last item.

    Would be great if anyone can help me to remove the white spaces.

    Attached a video:

    https://user-images.githubusercontent.com/4219513/124019021-6145f680-d99d-11eb-86fd-db8e4deb26d8.mp4

    opened by sopherwang 2
  • Question about PageStorage

    Question about PageStorage

    Hi, I don't known where I can make a question.

    I need to make infinite list with expandable tiles. Used packages expansion_tile_card infinite_listview

    In expansion_tile_card I have children widgets-buttons. I need to collapse expansion_tile_card when button pressed. But, how to I get state of expansion_tile_card from PageStorage? When I try, I not found State by index in builder. Example code: _buildTab is method name from example of infinite_listview This is not work and always returned null because in PageStorage can't found state for builded card.

    var s = PageStorage.of(context)
                              ?.readState(context, identifier: index);
    

    code example

     Widget _buildTab(int tab) {
        final ButtonStyle flatButtonStyle = TextButton.styleFrom(
          shape: const RoundedRectangleBorder(
            borderRadius: BorderRadius.all(Radius.circular(4.0)),
          ),
        );
    
        return InfiniteListView.separated(
          controller: _infiniteController,
          itemBuilder: (BuildContext context, int index) {
            return Padding(
              padding: const EdgeInsets.symmetric(horizontal: 12.0),
              child: ExpansionTileCard(
                key: PageStorageKey(index),
                leading: CircleAvatar(child: Text('A')),
                title: Text('Tap me!'),
                subtitle: Text('I expand!'),
                children: <Widget>[
                  Divider(
                    thickness: 1.0,
                    height: 1.0,
                  ),
                  Align(
                    alignment: Alignment.centerLeft,
                    child: Padding(
                      padding: const EdgeInsets.symmetric(
                        horizontal: 16.0,
                        vertical: 8.0,
                      ),
                      child: Text(
                        """Hi there, I'm a drop-in replacement for Flutter's ExpansionTile.
    
    Use me any time you think your app could benefit from being just a bit more Material.
    
    These buttons control the next card down!""",
                        style: Theme.of(context)
                            .textTheme
                            .bodyText2!
                            .copyWith(fontSize: 16),
                      ),
                    ),
                  ),
                  ButtonBar(
                    alignment: MainAxisAlignment.spaceAround,
                    buttonHeight: 52.0,
                    buttonMinWidth: 90.0,
                    children: <Widget>[
                      TextButton(
                        style: flatButtonStyle,
                        onPressed: () {
                          var s = PageStorage.of(context)
                              ?.readState(context, identifier: index);
                          print("");
                        },
                        child: Column(
                          children: <Widget>[
                            Icon(Icons.arrow_downward),
                            Padding(
                              padding: const EdgeInsets.symmetric(vertical: 2.0),
                            ),
                            Text('Open'),
                          ],
                        ),
                      ),
                      TextButton(
                        style: flatButtonStyle,
                        onPressed: () {
                          // keys[index]?.currentState?.collapse();
                        },
                        child: Column(
                          children: <Widget>[
                            Icon(Icons.arrow_upward),
                            Padding(
                              padding: const EdgeInsets.symmetric(vertical: 2.0),
                            ),
                            Text('Close'),
                          ],
                        ),
                      ),
                      TextButton(
                        style: flatButtonStyle,
                        onPressed: () {
                          // keys[index]?.currentState?.toggleExpansion();
                        },
                        child: Column(
                          children: <Widget>[
                            Icon(Icons.swap_vert),
                            Padding(
                              padding: const EdgeInsets.symmetric(vertical: 2.0),
                            ),
                            Text('Toggle'),
                          ],
                        ),
                      ),
                    ],
                  ),
                ],
              ),
            );
          },
          separatorBuilder: (BuildContext context, int index) =>
              const Divider(height: 2.0),
          anchor: 0.5,
        );
      }
    
    opened by 3DRaven 0
  • Combine with the scrollable_positioned_list pacakge

    Combine with the scrollable_positioned_list pacakge

    Is it possible to combine the package with the scrollable_positioned_list package? The features I'm looking to combine from the packages is the infinite scrolling and the listener of the currently visible items in the list.

    Issue in the other package: #75

    opened by essarn 1
Owner
Flutter Community
A central place for all community made Flutter packages. To get started, see the README of the 'community' repository.
Flutter Community
This package allows you to draw dotted lines with Flutter. You can draw a beautiful dotted line.

This package allows you to draw dotted lines with Flutter. You can draw a beautiful dotted line.

Tushar Nikam 1 Feb 9, 2022
🔁 A custom refresh indicator for flutter.

Liquid Pull To Refresh A beautiful and custom refresh indicator for flutter highly inspired from Ramotion Pull Down to Refresh. Table of contents Inst

Ayush Agarwal 1.1k Dec 23, 2022
scroll to index with fixed/variable row height inside Flutter scrollable widget

scroll-to-index This package provides the scroll to index mechanism for fixed/variable row height for Flutter scrollable widget. Getting Started In th

Quire 415 Jan 6, 2023
A Flutter package that builds a list view and notifies when the widgets are on screen.

inview_notifier_list A Flutter package that builds a ListView or CustomScrollView and notifies when the widgets are on screen within a provided area.

Vamsi Krishna 511 Dec 21, 2022
Flutter plugin that allows you to showcase your features on iOS and Android. 👌🔝🎉

ShowCaseView A Flutter package allows you to Showcase/Highlight your widgets step by step. It is inspired from Fluttery's Flutter challange. Preview I

Simform Solutions 1.1k Jan 7, 2023
Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple. Demo: https://gallery.codelessly.com/flutterwebsites/minimal/

Responsive Framework Responsiveness made simple Responsive Framework adapts your UI to different screen sizes automatically. Create your UI once and h

Codelessly 931 Dec 25, 2022
Effortless property builder for composing maintainable Flutter UI

Niku Effortless property builder for composing maintainable Flutter UI Why Creating UI in Flutter is easy. Its declarative enables developers to contr

SaltyAom 218 Dec 30, 2022
Compare your design and current flutter layout.

pixel_perfect Put a semi-transparent image with the design over the top of the developed layout. It helps you to compare original design and current p

Kherel 45 Oct 24, 2022
A flutter plugin for bluebooth ble device connect and control.

flutter_blue_elves A flutter plugin witch includes platform-specific implementation code for Android and/or iOS to connect and control bluetooth ble d

PineappleOilPrince 29 Dec 30, 2022
Device Preview For Flutter

Approximate how your app looks and performs on another device. Main features Preview any device from any device Change the device orientation Dynamic

null 3 May 14, 2022
NuConta Marketplace For Flutter

NuConta Marketplace telegram-cloud-document-1-5136388785566646724.mp4 Layout based in this drible project A Flutter project made using: Clean Dart tha

David Araujo 5 Nov 27, 2022
适用于 Flutter 的云片行为验证插件

flutter_yunpian_captcha 适用于 Flutter 的云片行为验证插件 屏幕截图 快速开始 安装 用法 获取 SDK 版本 初始化 SDK 开始验证 相关链接 许可证 屏幕截图 快速开始 安装 将此添加到包的 pubspec.yaml 文件中: dependencies: f

LeanFlutter 5 Mar 16, 2021
🎥 Movie app which is developed using flutter and powered by tmdb.

Fluttery Filmy ?? Movie app which is developed using flutter and powered by tmdb. Preview Screenshot Listing Screen Detail Screen What's next? Movies

Bhavik Makwana 197 Dec 28, 2022
Flutter Bidirectional ListView - ListView with items that can be scrolled in both directions with a fixed item count and scroll boundaries.

Flutter Bidirectional ListView ListView with items that can be scrolled and lazy loaded in up and down direction with a fixed item count and scroll bo

Christoph Rothermel 7 May 30, 2022
Flutter Sticky Headers - Lets you place "sticky headers" into any scrollable content in your Flutter app. No special wrappers or magic required. Maintainer: @slightfoot

Flutter Sticky Headers Lets you place headers on scrollable content that will stick to the top of the container whilst the content is scrolled. Usage

Flutter Community 903 Jan 4, 2023
State Persistence - Persist state across app launches. By default this library store state as a local JSON file called `data.json` in the applications data directory. Maintainer: @slightfoot

State Persistence Persist state across app launches. By default this library store state as a local JSON file called data.json in the applications dat

Flutter Community 70 Sep 28, 2022
A Very Flexible Widget that can Implement Material Sheets on all Directions, both modal and persistent, and consequently a Material Navigation Drawer

Flutter_MaterialSheetAndNavigationDrawer If this project helped you reduce developement time or you just want to help me continue making useful tools

Bryan Cancel 30 Dec 4, 2021
A Flutter widget that scrolls text infinitely

⏩ A Flutter widget that scrolls text infinitely. Provides many customizations including custom scroll directions, durations, curves as well as pauses after every round.

Marcel Garus 219 Dec 29, 2022
A shopping cart application that lets the user create an account, select items, save the items in the cart, pay using the payment gateway, change account details and check order history.

Shopping Cart A new Flutter application. The main code file has all the code required for the mobile application. Getting Started This project is a st

null 1 Oct 14, 2021
A Flutter ListView in which items can be grouped into sections.

Grouped list package for Flutter. Now with beta support for null safety! A flutter ListView in which list items can be grouped to sections. Features S

Dimitrios Begnis 277 Dec 26, 2022