icon_animated 2.0.0
icon_animated: ^2.0.0 copied to clipboard
Animated outline icons for Flutter with forward and reverse transitions, configurable colors, sizes, and stroke widths.
icon_animated #
Small outline icons. Smooth transitions. Native Flutter behavior.
Quick start · Configuration · Example · Migration · Changelog
At a glance #
- 14 built-in outline icons with forward and reverse animations.
- Uses the space allocated by the parent, including narrow layouts.
- Reuses path geometry between animation frames.
- Inherits IconTheme and supports semantic labels and reduced motion.
Quick start #
Requirements: Flutter 3.32+ · Dart 3.8+
flutter pub add icon_animated
To use this major version explicitly:
dependencies:
icon_animated: ^2.0.0
import 'package:flutter/material.dart';
import 'package:icon_animated/icon_animated.dart';
IconAnimated(
active: isSaved,
size: 48,
iconType: IconType.check,
semanticLabel: 'Saved',
)
Here, isSaved is a boolean from your application state.
Configuration #
| Option | Default | Purpose |
|---|---|---|
| active | required | Draw the icon when true; reverse when false. |
| size | required | Preferred width and height; parent constraints take precedence. |
| iconType | required | One of the 14 IconType values. |
| color | IconTheme | Optional icon color. |
| strokeWidth | 4% of shortest side | Optional positive stroke width. |
| duration | 700 ms | Animation duration; Duration.zero is immediate. |
| curve | Curves.easeInOutCirc | Animation curve. |
| semanticLabel | null | Accessible label; null marks a decorative icon. |
Icon catalog #
| Status | Actions | Navigation |
|---|---|---|
| check · fail · alert · error | search · message · add · download | menu · sort · filter · bluetooth |
| trendingUp · trendingDown |
Change active using setState or your preferred state management. The widget owns and
disposes its animation controller.
Package structure #
lib/
├── icon_animated.dart # Public exports
└── src/
├── icon_animated.dart # Widget and private lifecycle state
├── icon_type.dart # Icon enumeration
├── paths/ # Icon geometry grouped by purpose
└── rendering/ # Cached metrics and paint delegate
Import the package entry point. Files under src/ are implementation details and are
not a supported import surface.
Development #
flutter pub get
dart format --output=none --set-exit-if-changed lib example test
flutter analyze --fatal-infos
flutter test
flutter pub publish --dry-run
CI validates Flutter 3.32.0 and the latest stable channel. When switching SDK versions
locally, run flutter clean before testing to avoid reusing incompatible compiled
shader assets.
Upgrading from 1.x #
Version 2.0 includes intentional API changes. Follow MIGRATION.md before changing an existing application's dependency constraint.
Support and license #
Report reproducible issues in GitHub Issues. Include the Flutter version and a minimal example.
Released under the MIT license.