Last updated:
0 purchases
icon decoration
icon_decoration #
Add decoration capabilities to the Icon widget with borders and gradients. This new DecoratedIcon widget overlap itself with the base Icon widget to provide a more complete decoration system through a IconDecoration property.
Table of contents #
Add to your project
Add dependency to your pubspec.yaml
Import the package
How to use
Add borders to icons
Add gradients to icons
Mix them all together
Migration Guide
v2.0.0
Add to your project #
Add dependency to your pubspec.yaml #
icon_decoration: any
copied to clipboard
Import the package #
import 'package:icon_decoration/icon_decoration.dart';
copied to clipboard
How to use #
Add borders to icons #
DecoratedIcon(
icon: Icon(Icons.favorite, color: Colors.green),
decoration: IconDecoration(border: IconBorder()),
)
copied to clipboard
Add gradients to icons #
Gradients are supported on Flutter Web only with the canvaskit renderer
DecoratedIcon(
icon: Icon(Icons.all_inbox),
decoration: IconDecoration(
gradient: rainbowGradient,
),
)
copied to clipboard
Mix them all together #
DecoratedIcon(
icon: Icon(
Icons.all_inbox,
shadows: [
Shadow(
color: Colors.red,
blurRadius: 3,
offset: Offset(0, 2),
),
],
),
decoration: IconDecoration(
gradient: _rainbowGradient,
border: IconBorder(),
),
)
copied to clipboard
Migration Guide #
v2.0.0 #
Removed IconDecoration.shadows, use Icon.shadows instead.
Before
DecoratedIcon(
icon: Icon(Icons.all_inbox),
decoration: IconDecoration(
shadows: [
Shadow(
color: Colors.red,
blurRadius: 3,
offset: Offset(0, 2),
),
],
),
)
copied to clipboard
After
Icon(
Icons.all_inbox,
shadows: [
Shadow(
color: Colors.red,
blurRadius: 3,
offset: Offset(0, 2),
),
],
),
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.