GithubHelp home page GithubHelp logo

cgestes / flutter_expandable_sliver_list Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tnorbury/flutter_expandable_sliver_list

0.0 0.0 0.0 956 KB

Flutter widget allowing the user to create an expandable sliver list. Expand and collapse a list of items within a custom scroll view!

Home Page: https://pub.dev/packages/expandable_sliver_list

License: MIT License

Dart 100.00%

flutter_expandable_sliver_list's Introduction

expandable_sliver_list

pub package flutter_tests codecov style: effective dart License: MIT

A Flutter widget which creates a Sliver List that you can then either expand or collapse, in order to show or hide the contents of the list.

Getting Started

Installing

In your Flutter project, add the package to your dependencies

flutter pub add expandable_sliver_list

or

dependencies:
  ...
  expandable_sliver_list: ^4.1.0
  ...

Usage Example

A complete example on how to use this widget can be found in the example directory. But the basics are:

Import the package

import 'package:expandable_sliver_list/expandable_sliver_list.dart';

Create a controller and a list of items to display

ExpandableSliverListController controller = ExpandableSliverListController();

List<int> items = [1, 2, 3, 4, 5];

Create the widget

ExpandableSliverList<int>(
  initialItems: items,
  controller: controller,
  builder: (context, item, index) {
    return ListTile(
      title: Text(item.toString()),
    );
  },
)

Now you can use the controller to expand or collapse the list

controller.collapse();
controller.expand();

Or to add items to the list

controller.insertItem(54, 2);
controller.removeItem(4);

flutter_expandable_sliver_list's People

Contributors

splangi avatar tnorbury 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.