Search packages, repositories and app categories

animated_icon_button cover
Package detailsv1.0.2

animated_icon_button

Flutter package to create custom animated IconButton. Includes all available icons. Based on native IconButton.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
5.8K
Likes
295
Pub points
150

Install package

flutter pub add animated_icon_button

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that enhances the native IconButton with smooth, customizable animations. It supports all available icons and allows developers to create visually engaging button interactions with minimal code. Built on top of Flutter's native IconButton, it maintains compatibility while adding dynamic effects like scale, rotation, and color transitions. Ideal for modern UIs where user feedback and visual appeal are key.

Use cases

  • Creating interactive app buttons
  • Enhancing user feedback in forms
  • Adding micro-interactions in dashboards
  • Designing animated navigation elements
  • Improving accessibility through visual cues
  • Building engaging onboarding screens

Key features

  • Pre-built animation presets
  • Support for all Flutter icons
  • Customizable animation duration and curve
  • Easy integration with existing code
  • Lightweight and performant
  • Cross-platform compatibility

Suitable for

  • UI/UX designers seeking dynamic components
  • Developers building interactive apps
  • Projects requiring subtle yet effective animations
  • Apps focused on user engagement
  • Teams using Flutter for multi-platform deployment

Considerations

  • May increase bundle size slightly
  • Animations should be used sparingly for performance
  • Not suitable for high-frequency button presses
  • Requires understanding of Flutter's animation system
  • Best paired with semantic button labels for accessibility

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

animated_icon_button

😊 Flutter package to create custom animated IconButton.

😵 Includes all available icons. Based on native IconButton.


Breaking Change

After 1.0.2 version you can use multiple icons.

Getting Started

Follow these steps to use this library

Add dependency
dependencies:
  animated_icon_button: ^1.0.2 #latest version
Add import package
import 'package:animated_icon_button/animated_icon_button.dart';
Easy to use

Simple example of use AnimatedIconButton
Put this code in your project at an screen and wait for magic 😊

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

Now you can use more than 2 icons Add new icons to your list and they will change one by one

    AnimatedIconButton(
        size: 35,
        onPressed: () {
            print('all icons pressed');
        },
        duration: const Duration(milliseconds: 200),
        icons: <AnimatedIconButtonEntry>[
            AnimatedIconButtonEntry(
                icon: Icon(
                    Icons.mic,
                    color: Colors.purple,
                ),
                onPressed: () => print('mic pressed'),
                backgroundColor: Colors.white,
            ),
            AnimatedIconButtonEntry(
                icon: Icon(
                    Icons.g_translate,
                    color: Colors.purple,
                ),
                backgroundColor: Colors.white,
            ),
            AnimatedIconButtonEntry(
                icon: Icon(
                    Icons.collections_sharp,
                    color: Colors.purple,
                ),
                backgroundColor: Colors.white,
            ),
        ],
    ),
Custom animation controller

In order to animate your icons in a custom way, like on text changed or when pressing a button, just use the animationController property as follows.

    var animationController = AnimationController(
        vsync: this,
        duration: Duration(milliseconds: 200),
        reverseDuration: Duration(milliseconds: 200),
    );

    AnimatedIconButton(
        animationController: animationController,
        size: 35,
        onPressed: () {
            print('all icons pressed');
        },
        duration: const Duration(milliseconds: 200),
        icons: <AnimatedIconButtonEntry>[
            AnimatedIconButtonEntry(
                icon: Icon(
                    Icons.mic,
                    color: Colors.purple,
                ),
                onPressed: () => print('mic pressed'),
                backgroundColor: Colors.white,
            ),
            AnimatedIconButtonEntry(
                icon: Icon(
                    Icons.g_translate,
                    color: Colors.purple,
                ),
                backgroundColor: Colors.white,
            ),
            AnimatedIconButtonEntry(
                icon: Icon(
                    Icons.collections_sharp,
                    color: Colors.purple,
                ),
                backgroundColor: Colors.white,
            ),
        ],
    ),

Then, whenever you want, execute your animationController.forward() and animationController.reverse() methods to get your icons animated.

Don't forget when you use this property duration is not used, so it can be emitted.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package