Skip to content

yehorh/sliver_expandable

 
 

Repository files navigation

Sliver Expandable

Sliver Expandable lets expand and collapse any Sliver in Flutter.

Getting started

  1. Add it to your pubspec.yaml:
sliver_expandable: ^0.0.1
  1. Use it:
AnimatedSliverExpandable(
  headerBuilder: (context, animation, onToggle) => ListTile(
    onTap: onToggle,
    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,
    ),
  ),
),

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 34.2%
  • CMake 30.0%
  • Dart 24.6%
  • C 3.0%
  • HTML 2.7%
  • Swift 1.9%
  • Other 3.6%