FLUTTER ECOSYSTEM

TesteurManiak/icon_decoration

아이콘 위젯에 그림자, 테두리, 그라데이션과 같은 장식 기능을 추가합니다.

아이콘 장식 프로젝트 이미지
Stars
25
Forks
3
최근 푸시(UTC)
2026. 2. 3.
프로젝트 상태
활성
Guillaume Roux GitHub avatar
GITHUB User

Guillaume Roux ↗

Flutter Software Engineer, co-organizer of Flutter Lyon

Veson NauticalLyon, France공식 웹사이트 ↗
언어DartHTML

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 5 개
  • flutter{"sdk":"flutter"}
  • alchemist개발 의존성{"git":{"url":"https://github.com/Betterment/alchemist.git","ref":"ab1f2eb49584339be119eaec28a5562f6b325cbc"}}
  • fd_lints개발 의존성^2.3.0
  • flutter_test개발 의존성{"sdk":"flutter"}
  • meta개발 의존성^1.15.0

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

icon_decoration

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.

Table of contents

Add to your project

Add dependency to your pubspec.yaml
icon_decoration: any
Import the package
import 'package:icon_decoration/icon_decoration.dart';

How to use

Add borders to icons
https://raw.githubusercontent.com/TesteurManiak/icon_decoration/refs/heads/main/screenshots/border_with_colorized_icon.png
DecoratedIcon(
    icon: Icon(Icons.favorite, color: Colors.green),
    decoration: IconDecoration(border: IconBorder()),
)
Add gradients to icons

Gradients are supported on Flutter Web only with the canvaskit renderer

https://raw.githubusercontent.com/TesteurManiak/icon_decoration/refs/heads/main/screenshots/base_gradient.png
DecoratedIcon(
    icon: Icon(Icons.all_inbox),
    decoration: IconDecoration(
        gradient: rainbowGradient,
    ),
)
Mix them all together
https://raw.githubusercontent.com/TesteurManiak/icon_decoration/refs/heads/main/screenshots/gradient_with_border_and_shadow.png
DecoratedIcon(
    icon: Icon(
        Icons.all_inbox,
        shadows: [
            Shadow(
                color: Colors.red,
                blurRadius: 3,
                offset: Offset(0, 2),
            ),
        ],
    ),
    decoration: IconDecoration(
        gradient: _rainbowGradient,
        border: IconBorder(),
    ),
)

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),
            ),
        ],
    ),
)

After

Icon(
    Icons.all_inbox,
    shadows: [
        Shadow(
            color: Colors.red,
            blurRadius: 3,
            offset: Offset(0, 2),
        ),
    ],
),