Skip to content

2-5-perceivers/expand

Repository files navigation

Expand

GitHub stars Package: expand Language: Dart License: MIT

expand is a Flutter package designed to help creating sleek, fast and simple expandable widgets, using minimum code.

Demo Gif

Installation

To use this package, add expand as a dependency using:

flutter pub add expand

Getting started

Wrap any list of expandable widgets in a ExpandableProvider, and you are done.

Usage

Here is a basic example of how to use ExpandableTile:

ExpandableProvider(
child: ListView(
  children: [
    ExpandableTile(
      title: const Text('Tile 1'),
      detailsBuilder: (context) => Container(height: 200),
    ),
    ExpandableTile(
      title: const Text('Tile 2'),
      detailsBuilder: (context) => Container(height: 200),
    ),
  ],
),
),

The use of ExpandableProvider can be skipped using an ExpandableController that can be provided manually.

Key components

  • ExpandableProvider + ExpandableController: the state providers for expansion cards
  • ExpandableCard: The base of all expandable widgets
  • ExpandableTile: An ListTile with expandable details

For further details, visit the documentation.