fluentIconFallback function

IconData? fluentIconFallback(
  1. IconData icon
)

Returns the FluentIcons glyph that has the same name as the WindowsIcons glyph icon.

Returns null when icon is not a WindowsIcons glyph or no FluentIcons glyph has its name. Use it for one icon:

WindowsIcon(icon, fallbackIcon: fluentIconFallback(icon))

or for every WindowsIcon built without a WindowsIcon.fallbackIcon:

WindowsIcon.fallbackResolver = fluentIconFallback;

Implementation

IconData? fluentIconFallback(IconData icon) {
  for (final MapEntry(key: name, value: windowsIcon)
      in WindowsIcons.allIcons.entries) {
    if (windowsIcon == icon) return FluentIcons.allIcons[name];
  }
  return null;
}