icon_decoration
테두리와 그라디언트를 사용하여 Icon 위젯에 장식 기능을 추가합니다.
97좋아요 2.5천30일 다운로드150Pub 점수
AndroidiOSWebmacOSWindowsLinux
아이콘 위젯에 그림자, 테두리, 그라데이션과 같은 장식 기능을 추가합니다.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Pub Version Test workflow Coverage Status
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.
pubspec.yamlicon_decoration: any
import 'package:icon_decoration/icon_decoration.dart';
DecoratedIcon(
icon: Icon(Icons.favorite, color: Colors.green),
decoration: IconDecoration(border: IconBorder()),
)
Gradients are supported on Flutter Web only with the canvaskit renderer
https://raw.githubusercontent.com/TesteurManiak/icon_decoration/refs/heads/main/screenshots/base_gradient.pngDecoratedIcon(
icon: Icon(Icons.all_inbox),
decoration: IconDecoration(
gradient: rainbowGradient,
),
)
DecoratedIcon(
icon: Icon(
Icons.all_inbox,
shadows: [
Shadow(
color: Colors.red,
blurRadius: 3,
offset: Offset(0, 2),
),
],
),
decoration: IconDecoration(
gradient: _rainbowGradient,
border: IconBorder(),
),
)
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),
),
],
),
)
After
Icon(
Icons.all_inbox,
shadows: [
Shadow(
color: Colors.red,
blurRadius: 3,
offset: Offset(0, 2),
),
],
),