Sticky Infinite List
Infinite list with sticky headers.
This package was made in order to make possible
render infinite list in both directions with sticky headers, unlike most
packages in Dart Pub.
Supports various header positioning. Also supports Vertical and
Horizontal scroll list
It highly customizable and doesn't have any third party dependencies or native(Android/iOS) code.
In addition to default usage, this package exposes some classes, that
can be overridden if needed. Also some classes it can be used inside
Scrollable widgets independently from InfiniteList
container.
This package uses CustomScrollView
to perform scroll with all
benefits for performance that Flutter provides.
Features
- sticky headers within infinite list
- multi directional infinite list
- customization for sticky header position
- horizontal sticky list support
- dynamic header build on content scroll
- dynamic min offset calculation on content scroll
Demo

Getting Started
Install package and import
Package exposes InfiniteList
, InfiniteListItem
, StickyListItem
,
StickyListItemRenderObject
classes
Examples
Simple example
To start using Infinite list with sticky headers,
you need to create instance InfiniteList
with builder specified.
No need to specify any additional config to make it work
State
When min offset callback invoked or header builder is invoked
object StickyState
is passed as parameter
This object describes current state for sticky header.
Extended configuration
Available configuration
Alongside with minimal config to start using.
InfiniteList
allows you to define config for scroll list rendering
InfiniteListItem
allows you to specify more options for you customization.
Demos
Header alignment demo

Horizontal scroll demo

Reverse infinite scroll
Currently package doesn't support CustomScrollView.reverse
option.
But same result can be achieved with defining anchor = 1
and
maxChildCount = 0
. In that way viewport center will be stick
to the bottom and positive list won't render anything.
Additionally you can specify headerAlignment
to any side.
Demo

For more info take a look at
Example project
Available for override
In most cases it will be enough to just use InfiniteListItem
But in some cases you may need to add additional functionality to
each item.
Luckily you can extend and override base InfiniteListItem
class
Need more override?..
If you get any problems with this type of override,
please create an issue
Alongside with list item override, to use inside InfiniteList
builder,
you can also use StickyListItem
, that exposed by this package too, independently.
This class uses Stream
to inform it's parent about header position changes
Also it requires to be rendered inside Scrollable
widget and Viewport
,
since it subscribes to scroll event and calculates position
against Viewport
coordinates (see StickyListItemRenderObject
class
for more information)
For example
This code will render single child scroll
with 3 widgets. Middle one - item with sticky header.
Demo

For more complex example please take a look at "Single Example" page
in Example project
GitHub
https://github.com/TatsuUkraine/flutter_sticky_infinite_list