FIcons class final

The icon tokens. Defaults to Lucide icons.

Customizing icons

To change the icons used by Forui widgets, pass a FIcons to FThemeData.

Icons in FIcons should inherit their properties from the ambient IconTheme. Packages that represent icons as IconData inherit automatically; use iconData to wrap them.

For example, to use the in-built Material icons:

FThemeData(
  colors: FColors.zincLight,
  touch: false,
  icons: FIcons(
    arrowLeft: FIcons.iconData(Icons.arrow_left),
    calendar: FIcons.iconData(Icons.calendar_month),
    check: FIcons.iconData(Icons.check),
    // ...
  ),
);

Packages with duotone or multi-color glyphs typically expose a custom icon widget instead. As long as the widget inherits from the ambient IconTheme, you can pass it directly.

Known-compatible packages:

  • font_awesome_flutter
  • hugeicons

Custom widgets that do not inherit from the ambient IconTheme (e.g. SVG-based packages) must read the data themselves. Wrap the callback in a Builder so IconTheme.of is evaluated inside the caller's wrap:

FThemeData(
  colors: FColors.zincLight,
  touch: false,
  icons: FIcons(
    arrowLeft: (_, {semanticsLabel}) => Builder(builder: (context) {
      final data = IconTheme.of(context);
      return SvgPicture.asset(
        'assets/arrow_left.svg',
        width: data.size,
        height: data.size,
        colorFilter: data.color == null ? null : ColorFilter.mode(data.color!, BlendMode.srcIn),
        semanticsLabel: semanticsLabel,
      );
    }),
    // ...
  ),
);

See FThemes for predefined themes.

Mixed-in types

Constructors

FIcons({required FIconBuilder arrowLeft, required FIconBuilder calendar, required FIconBuilder check, required FIconBuilder chevronDown, required FIconBuilder chevronLeft, required FIconBuilder chevronRight, required FIconBuilder chevronUp, required FIconBuilder chevronsUpDown, required FIconBuilder circleAlert, required FIconBuilder clock4, required FIconBuilder ellipsis, required FIconBuilder eye, required FIconBuilder eyeClosed, required FIconBuilder gripHorizontal, required FIconBuilder gripVertical, required FIconBuilder loader, required FIconBuilder loaderCircle, required FIconBuilder loaderPinwheel, required FIconBuilder search, required FIconBuilder userRound, required FIconBuilder x})
Creates a FIcons with the given builders.
const
FIcons.lucide()
Creates a FIcons backed by FLucideIcons defaults.

Properties

arrowLeft FIconBuilder
A left-pointing arrow.
final
calendar FIconBuilder
A calendar.
final
check FIconBuilder
A check mark.
final
chevronDown FIconBuilder
A downward-pointing chevron.
final
chevronLeft FIconBuilder
A left-pointing chevron.
final
chevronRight FIconBuilder
A right-pointing chevron.
final
chevronsUpDown FIconBuilder
A pair of vertically-stacked chevrons.
final
chevronUp FIconBuilder
An upward-pointing chevron.
final
circleAlert FIconBuilder
An alert / warning indicator inside a circle.
final
clock4 FIconBuilder
A clock with a 4 o'clock indicator.
final
ellipsis FIconBuilder
A horizontal ellipsis (three dots).
final
eye FIconBuilder
An open eye.
final
eyeClosed FIconBuilder
A closed eye.
final
gripHorizontal FIconBuilder
A horizontal grip handle.
final
gripVertical FIconBuilder
A vertical grip handle.
final
hashCode int
The hash code for this object.
no setterinherited
loader FIconBuilder
A loading indicator (segments).
final
loaderCircle FIconBuilder
A loading indicator (circular).
final
loaderPinwheel FIconBuilder
A loading indicator (pinwheel).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
A search / magnifying glass.
final
userRound FIconBuilder
A user silhouette in a circle.
final
x FIconBuilder
An "x" / close mark.
final

Methods

debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

iconData(IconData icon) FIconBuilder
A builder that renders the given IconData as a Flutter Icon.