Search categories, packages and repositories

expandable_sliver_list cover
Package detailsv4.1.1

expandable_sliver_list

A sliver List that you can then either expand or collapse, in order to show or hide the contents of the list.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
797
Likes
29
Pub points
160

Install package

flutter pub add expandable_sliver_list

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that provides a sliver list capable of expanding or collapsing to reveal or hide its contents. Ideal for dynamic, space-efficient layouts where users need control over content visibility. Built specifically for use within CustomScrollView, it integrates seamlessly with the sliver architecture. The package supports all major platforms and is designed for smooth performance during transitions.

Use cases

  • Dynamic content sections
  • Collapsible FAQ sections
  • Interactive navigation menus
  • Reducing screen clutter
  • Nested scrollable interfaces
  • Accordions in scroll views

Key features

  • Expandable/collapsible behavior
  • Sliver-based performance
  • Smooth animations
  • Customizable triggers
  • Works within CustomScrollView
  • Cross-platform compatibility

Suitable for

  • Developers building scrollable UIs with collapsible content
  • Apps needing responsive layout management
  • Projects using CustomScrollView extensively
  • Designers prioritizing space efficiency

Considerations

  • Requires integration within CustomScrollView
  • May impact performance with large lists
  • Limited to vertical scrolling
  • Needs careful state management
  • Not suitable for non-sliver contexts

Original README

Original README snapshot from the linked source repository. Visit the repository 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);

Categories

Source repository

Projects using this package

No data available yet.