Icon

An icon that inherits its style from an enclosing, supported widget, such as a button.

Usage

FIcon(...)

FIcon(
  FAssets.icons.bird,
  color: Colors.red,
  size: 24,
  semanticLabel: 'Label',
);

FIcon.data(...)

This should be used with icons in other libraries, such as Cupertino and Material, that embed their icons as IconDatas.

FIcon.data(
  Icons.abc,
  color: Colors.red,
  size: 24,
  semanticLabel: 'Label',
);

FIcon.image(...)

FIcon.image(
  NetworkImage('https://raw.githubusercontent.com/forus-labs/forui/main/samples/assets/avatar.png'),
  color: Colors.red,
  size: 24,
  semanticLabel: 'Label',
);

FIcon.raw(...)

FIcon.raw(
  builder: (context, style, child) => Container(
    color: style.color,
    height: style.size,
    width: style.size,
    child: child!,
  ),
  child: const Text('Button'),
);

Examples

Bundled/SVG

IconData

Image

⚠️

It is important that the image’s background is transparent. An image with a non-transparent background will be completely filled with a single color.

Raw