Flutter
Solar Icons as Flutter widgets, generated from the static catalogue.
flutter pub add flutter_solar_iconsStatic widgets
Each icon ships one widget per style. The style is in the import path and in the widget name, and only that style's SVG is embedded:
import 'package:flutter_solar_icons/linear/home.dart';
HomeLinearIcon(
size: 32,
color: Color(0xFF1C274C),
strokeWidth: 2,
)Style barrels (linear.dart, bold.dart, bold_duotone.dart, broken.dart, line_duotone.dart, outline.dart) and the package root export the same widgets under the same names.
Dynamic widgets
One widget covers every icon and style for names or styles that are only known at runtime. It embeds all six SVGs, so prefer the static widgets when the style is known upfront:
import 'package:flutter_solar_icons/dynamic/arrow_right.dart';
ArrowRightIcon(
style: SolarIconStyle.boldDuotone,
secondaryColor: Color(0xFF94A3B8),
secondaryOpacity: 0.5,
)Each dynamic widget also exposes its six payloads. Pass one to SolarIcon when you want the data directly:
SolarIcon(HomeIcon.outline, size: 20)Theme
SolarProvider sets defaults for icons below it. Arguments on the icon win, then the provider, then the ambient IconTheme. Stroke width falls back to 1.5. style also falls back to the provider, so one wrapper can set the style for every dynamic widget inside it; static widgets always draw their own style:
SolarProvider(
size: 24,
color: Color(0xFF111827),
strokeWidth: 1.5,
style: SolarIconStyle.bold,
child: HomeIcon(),
)Set isolated: true to ignore SolarProvider and the ambient IconTheme and use the package defaults: 24px, #1C274C, and a 1.5 stroke.
Duotone
boldDuotone and lineDuotone paint a second color on the accent layer. secondaryColor defaults to the primary color, secondaryOpacity defaults to 0.5:
HeartLineDuotoneIcon(
color: Color(0xFF1C274C),
secondaryColor: Color(0xFF94A3B8),
secondaryOpacity: 0.4,
)Deprecated names
Renamed icons keep working through @Deprecated typedefs that point at the canonical widget:
// Deprecated: use ChatSquareUnreadLinearIcon instead.
ChatUnreadLinearIcon()Accessibility
Pass semanticLabel to announce the icon to screen readers. Icons without a label are excluded from semantics:
HomeLinearIcon(semanticLabel: 'Home')How is this guide?
Last updated on