Skip to content
pubscout

icon_decoration

2.1.0, released 2 years ago by rouxguillau.me

Provides a DecoratedIcon widget to add borders and gradients to icons.

WASM-ready
$ flutter pub add icon_decoration
Source repository

What it does

Adds decoration capabilities to the standard Icon widget via a DecoratedIcon wrapper. You can apply borders, gradients (Web only), and use the Icon's own shadow property. The widget overlays the decoration on the base icon.

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

Use it when

  • You need simple borders or gradient fills on icons without writing custom painters
  • You want a drop‑in replacement for Icon that supports extra styling

Skip it when

  • You require complex animated icon effects
  • You need shadow support through the decoration API (shadows are now handled by Icon)
  • You target platforms where gradient support is unavailable (non‑Web)

Strengths

  • Very easy to integrate – just replace Icon with DecoratedIcon
  • Supports gradient fills on Flutter Web
  • Leverages existing Icon shadows, keeping API familiar

Weaknesses

  • Gradients only work on Web (CanvasKit)
  • No longer supports shadows via IconDecoration (must use Icon.shadows)
  • Limited to icon decoration; not a full UI kit

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
DecoratedIcon(
  icon: Icon(Icons.favorite, color: Colors.green),
  decoration: IconDecoration(border: IconBorder()),
);

Alternatives

Packages that do the same job and could replace icon_decoration.