sliver_expandable 1.1.0 copy "sliver_expandable: ^1.1.0" to clipboard
sliver_expandable: ^1.1.0 copied to clipboard

A Sliver Flutter widget that can be used to expand or collapse another child Sliver widget

Sliver Expandable #

Sliver Expandable lets expand and collapse any Sliver in Flutter.

Getting started #

  1. Add it to your pubspec.yaml:
sliver_expandable: ^1.1.0
  1. Use it:
AnimatedSliverExpandable(
  expanded: _expanded,
  headerBuilder: (context, animation) => ListTile(
    onTap: () => setState(() => _expanded = !_expanded),
    tileColor: Colors.amber,
    title: const Text('Expandable'),
    trailing: AnimatedBuilder(
      animation: animation,
      builder: (context, child) => Transform.rotate(
        angle: (animation.value - 0.5) * pi,
        child: child,
      ),
      child: const Icon(Icons.chevron_left),
    ),
  ),
  sliver: SliverList(
    delegate: SliverChildBuilderDelegate(
      (context, index) => ListTile(
        title: Text('Expandable item no. $index'),
      ),
      childCount: 5,
    ),
  ),
),
4
likes
140
pub points
78%
popularity
screenshot

Publisher

unverified uploader

A Sliver Flutter widget that can be used to expand or collapse another child Sliver widget

Repository (GitHub)
View/report issues

Topics

#sliver #widget #expandable

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on sliver_expandable