expand is a Flutter package designed to help creating sleek, fast and simple expandable widgets, using minimum code.
To use this package, add expand as a dependency using:
flutter pub add expand
Wrap any list of expandable widgets in a ExpandableProvider, and you are done.
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.
ExpandableProvider
+ExpandableController
: the state providers for expansion cardsExpandableCard
: The base of all expandable widgetsExpandableTile
: An ListTile with expandable details
For further details, visit the documentation.