logo

Hcody

Home/ Projects / asset-icon

Project: AssetIcon

AssetIcon - Customizable Flutter Asset-Based Icon Package

By Hisham ยท Published on November 05, 2024

Intro

AssetIcon is a powerful Flutter package for rendering PNG, SVG, and other asset-based icons with customization, accessibility, and code generation.

Description

AssetIcon is a powerful and customizable Flutter package for rendering asset-based icons with ease. Whether you're working with PNG, SVG, or other formats, this package allows you to adjust properties such as size, color, and opacity.

๐Ÿ“ Format Support

Seamlessly display PNG and SVG icons in a single widget.

๐ŸŽจ Customization

Modify size, color, and opacity to fit your app's theme.

๐Ÿš€ Automation

Generate constant Dart keys for all icons automatically.

Installation & Usage

dependencies:
  assets_icon: ^latest_version

Generate your icon keys with one command:

dart run asset_icon:generate --source-dir assets/icons/ --output-dir lib/generated
The Challenges
  • Difficulty managing icons spread across multiple directories.
  • Lack of native SVG support in standard ImageIcon.
  • Risk of typos when manually typing asset paths.
  • Maintaining accessibility (semantic labels) consistently.
The Solutions

AssetIcon bridges these gaps by providing a unified widget for all formats, global configuration for consistent styling, and automated code generation that ensures your asset paths are always accurate and type-safe.