collapsible
1.0.0, released 6 years ago by jamesalex.dev
A widget that collapses and expands its child by clipping it.
WASM-ready
What it does
Collapsible wraps a child widget and animates its size to hide or reveal the child. It supports clipping, fading, custom curves, and duration control.
AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a simple animated hide/show of a widget without managing layout yourself
- You want to collapse a section of UI with optional fade and state retention
Skip it when
- You require complex multi‑step animations beyond simple size clipping
- You need to keep the child fully built and interactive while hidden without extra configuration
Strengths
- Very small API focused on collapse/expand
- Supports fade, custom curves, and maintainState/maintainAnimation
- Works on all Flutter platforms
Weaknesses
- Only animates size clipping, not other layout effects
- No built‑in support for accessibility announcements
- Limited to Flutter, no web‑specific optimizations
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Collapsible(
collapsed: _collapsed,
axis: CollapsibleAxis.both,
child: MyWidget(),
);Alternatives
Packages that do the same job and could replace collapsible.
- expandable_reorderable_list
Wrapper around ReorderableListView that adds tree structure, expand/collapse, and reordering.
49Compare - sliver_expandable
A Sliver Flutter widget that expands or collapses another child Sliver widget.
47Compare - sticky_and_expandable_list
Grouped list with sticky headers and expandable sections for CustomScrollView
50Compare - expandable_sliver_list
A sliver list widget that can be expanded or collapsed to show or hide its contents.
49Compare