name: hugeicons-usage
description: Guidelines for using the Hugeicons Flutter package, covering widget usage, customization, and theme integration.
Hugeicons Usage Guide
Core Guidelines
- Use the
HugeIconwidget: Always use the providedHugeIconwidget for rendering icons. - Icon Data Type:
HugeIcon.iconexpectsList<List<dynamic>>.HugeIcons.*constants are SVG JSON/path data, not FlutterIconData. - Do Not Use
Icon: Do not renderHugeIcons.*constants with Flutter'sIconwidget. Pass them toHugeIcon. - Icon Constants: Icons are accessed through the
HugeIconsclass (e.g.,HugeIcons.strokeRoundedUser). - Theme Color Inheritance: By default,
HugeIconinherits the color from the currentIconTheme. You can override this using thecolorproperty. - Size: The default size is 24.0. Use the
sizeproperty to scale the icon. - Stroke Width: For stroke-based icons (most icons in this package), you can customize the thickness using the
strokeWidthproperty.
Examples
Simple Usage
HugeIcon(
icon: HugeIcons.strokeRoundedHome01,
color: Colors.black,
size: 24.0,
)
With Color Inheritance
IconTheme(
data: IconThemeData(color: Colors.blue, size: 32.0),
child: HugeIcon(
icon: HugeIcons.strokeRoundedSettings01,
),
)
Custom Stroke Width
HugeIcon(
icon: HugeIcons.strokeRoundedFavorite,
color: Colors.red,
strokeWidth: 2.5,
)
Troubleshooting
- Icon not showing: Ensure the
iconproperty is not null and is a valid constant fromHugeIcons. - Type errors: If code expects
IconData, it is using the wrong type. Hugeicons icon constants areList<List<dynamic>>. - Unexpected Color: Check if a parent
IconThemeorDefaultTextStyleis providing a color you don't expect.