Skip to content

A Flutter List View that calculate the max scroll extent precisely

Notifications You must be signed in to change notification settings

BYR-App-Dev/LoadedListView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loaded List View

Flutter just provide an estimated max scroll extent of the list view. Therefore it might be difficult to directly jump to the bottom of the list view without reversing the list view.

By override a small piece of code can make this possible. The point is that RenderSliverList only stores "useful" items and this leads to the unprecise estimation of other "unuseful" items. Thus, considering every item as useful will make the estimation precise.

Please note that this modification may affect the performance of the rendering

Example

an example based on official get-started example which will jump to bottom after every pull-up-to-refresh and jump to top after every pull-down-to-refresh.

Usage

import this repository into the project

loaded_list_view:
    git:
      url: git://github.com/DawenZhang/LoadedListView.git

then use it somewhere in the code

import 'package:loaded_list_view/loaded_list_view.dart';

.
.
.

LoadedListView.separated(
    controller: ,
    itemCount: ,
    separatorBuilder: ,
    itemBuilder: ,
);

.
.
.

_controller.position.maxScrollExtent

better use with DualRefreshIndicator

About

A Flutter List View that calculate the max scroll extent precisely

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published