Skip to content

A ListView widget capable of pinning a child to the top of the list.

License

Notifications You must be signed in to change notification settings

janhrastnik/pinnable_listview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PinnableListView

A Flutter ListView widget that allows pinning a ListView child to the top of the list.

Demo

Getting Started

Define the list

  PinController pinController = PinController();

  @override
  Widget build(BuildContext context) {
      return PinnableListView(
          pinController: pinController,
          children: listOfWidgets
      );
  }

Then pin a widget with

  pinController.pin(index)

index meaning the child which you'd like to pin/unpin.

See the example app for more details.

Problems

  • Calling setState on PinnableListView after it has changed will crash the list, because it will try to reload the original list.
  • Missing implementation for PinnableListView.builder.
  • Changing the size of a child after first build will crash the list, as the list calculates widget heights based on the render boxes at the beginning of the app.

About

A ListView widget capable of pinning a child to the top of the list.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published