Code Monkey home page Code Monkey logo

snappy_list_view's Introduction

pub package

Beta version

SnappyListView provides you with everything to make your list snap to each element - essentially like a PageView widget, but while displaying every element in a list format. This means that this widget also enables you to have different sizes of items. Main features include:

  • Different and variable sizes of items in both scroll- and orthogonal direction size
  • Configurable overscroll snapping physics (overscroll multiple pages when high velocity)
  • List visualisation (customize or choose out of a range functions, such as wheel, carousel, or perspective)
  • Full control where your items should snap in the viewport and on each item
  • Simply use a PageController to get feedback and control your list

Important Note: This widget behaves just like a PageView widget. Meaning that any usage in a Column, Stack or else where equals the usage of a PageView.

Features

This is a beta version of this plugin, no visual features are yet available

Usage

SnappyListView
(
itemCount: Colors.accents.length,itemBuilder: (
context, index) {
return Container(
height: 100,
color: Colors.accents.elementAt(index),
child: Text("Index: $index"),
),
);

Tip: full interactive example in ./example folder.

Main Parameters

  • required int itemCount - your item count, if it changes simply call setState() on the widget
  • required Widget Function(BuildContext, int) itemBuilder - builder for your items (building only the ones that are needed)
  • PageController controller- use the known PageController with functions such as jumpTo(index), animateTo(index), .currentPage, etc.
  • ScrollPhysics? physics - add your custom snap physics such you own (mass, stiffness, damping)
  • bool itemSnapping - control whether your list should snap
  • bool reverse - reverse the list (just like in ListView)
  • ItemPositionsListener itemPositionsListener - listen to the exact item position in the viewport
  • void Function(int index, double size)? onPageChanged - get feedback on the current changing index and size
  • void Function(double index, double size)? onPageChange - get feedback on the current index and size change
  • PageOverscrollPhysics? overscrollPhysics - configure how "fast" a overscroll should happen
  • ListVisualisation visualisation - display items like carousel, perspective, wheel, etc. (and custom)
  • SnapAlignment snapAlignment- where the snap point is supposed to be on in the viewport. Dynamic behavior is also possible.
  • SnapAlignment snapOnItemAlignment - where the snap point is supposed to be on each item. Dynamic behavior is also possible.

And many more such as (scrollBehavior,minCacheExtent,onPageChanged, etc. )

Additional information

Contributions are very welcome and are merged after testing within hours.

snappy_list_view's People

Contributors

polarby avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.