{"id":20684107,"url":"https://github.com/hesham04dev/asset_icon","last_synced_at":"2026-02-18T11:37:06.538Z","repository":{"id":261186758,"uuid":"883546509","full_name":"hesham04Dev/asset_icon","owner":"hesham04Dev","description":"🚀A powerful and customizable Flutter package for rendering asset-based icons with ease","archived":false,"fork":false,"pushed_at":"2025-03-15T10:07:07.000Z","size":70,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T21:03:42.310Z","etag":null,"topics":["assets-icon","dart","flutter","icons"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hesham04Dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-05T06:43:51.000Z","updated_at":"2025-03-15T10:07:11.000Z","dependencies_parsed_at":"2024-11-05T07:20:14.675Z","dependency_job_id":"027a95f8-7e6c-480c-912c-b9ca9faca1c1","html_url":"https://github.com/hesham04Dev/asset_icon","commit_stats":null,"previous_names":["hesham04dev/asset_icon"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hesham04Dev/asset_icon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hesham04Dev%2Fasset_icon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hesham04Dev%2Fasset_icon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hesham04Dev%2Fasset_icon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hesham04Dev%2Fasset_icon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hesham04Dev","download_url":"https://codeload.github.com/hesham04Dev/asset_icon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hesham04Dev%2Fasset_icon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29578018,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assets-icon","dart","flutter","icons"],"created_at":"2024-11-16T22:19:17.160Z","updated_at":"2026-02-18T11:37:01.529Z","avatar_url":"https://github.com/hesham04Dev.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# \u003cimg src=\"https://raw.githubusercontent.com/hesham04Dev/asset_icon/refs/heads/main/screenshots/logo.png\" width=\"30px\"/\u003e AssetIcon\n\n`AssetIcon` is a powerful and customizable Flutter package for rendering asset-based icons with ease. Whether you're working with PNG, SVG,and other formats, this package allows you to adjust properties such as size, color, and opacity. It also offers batch generation of Dart code for your asset keys, making it easier to manage large sets of icons.\n\n## ✨ Features\n\n- **📁 Multiple Format Support**: Display PNG and SVG icons seamlessly, along with support for other formats.\n- **🎨 Customization**: Easily modify icon size, color, and opacity to fit your app's theme.\n- **🔧 Global Configuration**: Set a default path and color for consistent icon styling throughout your app.\n- **🛡️ Accessibility**: Add semantic labels for better screen reader support.\n- **🚀 Automated Icon Key Generation**: Generate constant keys for all icons in your assets folder to streamline code usage.\n\n## 📦 Installation\n\nAdd `AssetIcon` to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  assets_icon: ^latest_version\n```\n\n## 🤔 How does the Icon should be?\nThe Icon should be one color with transparency\n![description](https://raw.githubusercontent.com/hesham04Dev/asset_icon/refs/heads/main/screenshots/how_should_the_icon_be.png)\n\n\n\n## 🚀 Getting Started\nBasic Usage\n```dart\nimport 'package:assets_icon/assets_icon.dart';\n\nAssetIcon(\n  'example_icon.png',  // Icon name (stored in assets/icons/)\n  semanticLabel: 'Example icon',    // Semantic label for accessibility\n)\n```\nWith Label\n```dart\nimport 'package:assets_icon/assets_icon.dart';\n\nAssetIcon.withLabel(\n  'example_icon.png',  \n  label: 'Example icon',\n  position: AssetIconLabelPosition.top\n)\n```\nWith Customization\n```dart\nAssetIcon(\n  'example_icon.svg',     // Icon name (must be in the asset folder)\n  size: 30.0,                       // Custom size\n  color: Colors.blue,               // Custom color\n  opacity: 0.7,                     // Custom opacity\n  semanticLabel: 'Example icon',    // Semantic label for accessibility\n)\n```\n\n## 🔄 Comparison with `ImageIcon`\n\n| Feature                         | AssetIcon              | ImageIcon                |\n|---------------------------------|------------------------|--------------------------|\n| **Support Svg**                 | Yes                    | No                       |\n| **Opacity**                     | Yes                    | No                       |\n| **Color Customization**         | Yes                    | Yes                      |\n| **Constant Key Generation**     | Yes                    | No                       |\n| **Online Icon Support**         | No                     | Yes                      |\n\n\n**Summary**: `AssetIcon` offers more flexibility with SVG support, opacity adjustments, and constant key generation, making it ideal for managing large icon libraries. `ImageIcon` may be sufficient for simple use cases with only PNGs.\n\n\n## ⚙️ Configuration\nTo set default values for the color and asset path globally, use the `settings` method:\n```dart\nAssetIcon.settings(\n  defaultColor: Colors.grey,\n  defaultPath: 'assets/icons/',\n);\n```\nThis will apply the specified defaults to any AssetIcon widget that does not provide these properties individually.\n\n## 💻 Code Generation for `asset_icon`\n\n`asset_icon:generate` provides a streamlined way to generate a Dart class containing keys for your asset files. This command is specifically tailored for handling icon assets such as PNG and SVG files and outputs a Dart file with constant strings for each asset, enabling you to reference icons in your Flutter code effortlessly.\n\n### Command Line Arguments\n\n| Argument                     | Short | Default             | Description                                                                            |\n|------------------------------|-------|---------------------|----------------------------------------------------------------------------------------|\n| `--help`                     | `-h`  |                     | Display help information.                                                              |\n| `--source-dir`               | `-S`  | `assets/icons/`     | The folder containing icon files.                                                      |\n| `--class-name`               | `-c`  | `AssetIcons`        | The name of the Dart class to be generated.                                            |\n| `--output-dir`               | `-O`  | `lib/generated`     | The output folder where the generated file will be saved.                              |\n| `--output-file`              | `-o`  | `icons.g.dart`      | The name of the output Dart file.                                                      |\n\n### Usage\n\nTo run the code generator, use the following command in your terminal:\n\n```bash\ndart run asset_icon:generate --source-dir assets/icons/ --class-name MyAssetIcons --output-dir lib/generated --output-file my_icons.g.dart\n```\n\nThen you can write like this:\n```dart\nimport 'path_to_lib_folder/generated/icons.g.dart';\n...\nAssetIcon(\n  AssetIcons.example,\n  semanticLabel: 'Example icon',\n)\n```\n\n## 📁 Example Folder Structure\nEnsure your icons are placed in the specified assets directory. For example:\n```md\nassets/\n└── icons/\n    ├── example_icon.png\n    ├── example_icon.svg\n    └── other_icon.png\n```\nThen, register the asset path in pubspec.yaml:\n```yaml\nflutter:\n  assets:\n    - assets/icons/\n```\n\n## 🤝 Contribute\nFeel free to contribute to AssetIcon by submitting issues or pull requests. We welcome contributions that enhance functionality or improve performance.\n\n## 📜 License\n`AssetIcon` is licensed under the MIT License.\n\n\u003c!-- TODO add the shape of icons and it should be one color and can be with opacity give example with images and how the shape become  --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhesham04dev%2Fasset_icon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhesham04dev%2Fasset_icon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhesham04dev%2Fasset_icon/lists"}