decorated_icon
1.2.1, released 5 years ago by benpesso.com
Lightweight icon widget that renders an icon with multiple shadows using a single Text widget.
What it does
`DecoratedIcon` displays a Flutter icon with a list of `BoxShadow`s applied. It inherits color and fontSize from the surrounding `IconTheme` and supports semantics and debugging. The widget is built with a single `Text` widget for efficient rendering.
AI-written summary of version 1.2.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need an icon with multiple shadows or an outer glow effect (within Flutter limits).
- You want a lightweight, single-widget solution without extra dependencies.
- You want the icon to automatically inherit theme colors and sizes.
Skip it when
- You require complex visual effects like true outer glow or custom shapes beyond shadows.
- You need advanced animation or interaction beyond simple shadow changes.
Strengths
- Very lightweight, single widget implementation.
- Supports multiple shadows with order control.
- Inherits theme color and fontSize automatically.
- Provides semantics and debugging support.
Weaknesses
- Cannot create true outer glow due to Flutter limitations.
- Limited to text-based shadows; no custom shapes or complex effects.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
```dart
import 'package:decorated_icon/decorated_icon.dart';
final decoratedIcons = Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: const [
DecoratedIcon(
Icons.android,
color: Colors.purple,
size: 60.0,
shadows: [
BoxShadow(
blurRadius: 42.0,
color: Colors.purpleAccent,
),
BoxShadow(
blurRadius: 12.0,
color: Colors.white,
),
],
),
DecoratedIcon(
Icons.favorite,
color: Colors.lightBlue.shade50,
size: 60.0,
shadows: [
BoxShadow(
blurRadius: 12.0,
color: Colors.blue,
),
BoxShadow(
blurRadius: 12.0,
color: Colors.green,
offset: Offset(0, 6.0),
),
],
),
DecoratedIcon(
Icons.fingerprint,
color: Colors.orange,
size: 60.0,
shadows: [
BoxShadow(
color: Colors.black,
offset: Offset(3.0, 3.0),
),
],
),
],
);
```Alternatives
Packages that do the same job and could replace decorated_icon.
- app_badge_plus
Flutter plugin to set numeric badges on app icons for iOS, Android, and macOS
84Compare - shadow_widget
A widget that adds a shadow effect to any Flutter widget.
49Compare - country_picker
A Flutter widget to pick a country from a list with optional phone code and search.
78Compare - iconsax_flutter
Flutter package providing a collection of Iconsax icons in multiple styles.
52Compare