Search categories, packages and repositories

GitHub repositoryTNorbury/flutter_expandable_sliver_list

flutter_expandable_sliver_list

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

flutter_expandable_sliver_list project cover
Stars
7
Forks
6
Last push (UTC)
Apr 6, 2024
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

expandable_sliver_list

pub package flutter_tests codecov style: flutter lints 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);
Tyler Norbury GitHub avatar
GitHub author

Tyler Norbury ↗

Head of Mobile Development at @vakaros

@vakarosUK
LanguagesDart

Categories

Packages published by this repository

Dependencies used

Dependency list 3 items

  • flutter{"sdk":"flutter"}
  • flutter_lintsDevelopment^2.0.1
  • flutter_testDevelopment{"sdk":"flutter"}

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗