Skip to content
pubscout

animated_icon_button

1.0.2, released 5 years ago by frezycode.com

Flutter package to create custom animated IconButtons based on the native IconButton.

WASM-ready
$ flutter pub add animated_icon_button
Source repository

What it does

Provides a widget to display an IconButton that animates between multiple icons sequentially when pressed or controlled via an AnimationController. It supports multiple icon entries with custom background colors and press handlers.

AI-written summary of version 1.0.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want an icon button that morphs or changes through a list of icons with an animation.
  • You need custom actions or background colors per icon state within a button.

Skip it when

  • You only need a static icon button without animations.
  • You require complex vector animations that are better suited for Rive or Lottie.

Strengths

  • Supports multiple icons rather than just toggle between two states.
  • Allows supplying a custom AnimationController for precise animation control.
  • Based on the native Flutter IconButton.

Weaknesses

  • The package has not received updates since 2021.
  • Relies on older dependency versions like freezed_annotation.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
1

not documented

AnimatedIconButton(
    onPressed: () => print('all icons pressed'),
    icons: [
        AnimatedIconButtonEntry(
            icon: Icon(Icons.add),
            onPressed: () => print('add pressed'),
        ),
        AnimatedIconButtonEntry(
            icon: Icon(Icons.close),
        ),
    ],
)

Alternatives

Packages that do the same job and could replace animated_icon_button.

Works with

Packages commonly used together with animated_icon_button: ones it builds on, ones built on it, and its own family.