Skip to content
pubscout

collapsible

1.0.0, released 6 years ago by jamesalex.dev

A widget that collapses and expands its child by clipping it.

WASM-ready
$ flutter pub add collapsible
Source repository

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.