phosphor-icons / flutter

A flexible icon family for Flutter
https://phosphoricons.com
MIT License
107 stars 12 forks source link

Export icons by type #9

Closed narcodico closed 1 year ago

narcodico commented 2 years ago

Hey @rektdeckard 👋

Great icon set! Would you mind also exporting lists or maps of icons grouped by type? e.g.: normal, bold, etc.

Thanks!

rektdeckard commented 1 year ago

Hu @narcodico, sorry I haven't got back to you. We're launching a 2.0 release very soon that has the weights split up by default!

narcodico commented 1 year ago

Hey @rektdeckard, that's great to hear, thanks for the update!

rektdeckard commented 1 year ago

2.0.0 is live with icon weights and backing fonts split.

narcodico commented 1 year ago

@rektdeckard would like to suggest a couple improvements to the current approach. You guys could go something around the likes of:

abstract class PhosphorIcons {
  static const bold = PhosphorIconsBold();
}
 class PhosphorIconsBold {
  const PhosphorIconsBold();

  final  addressBook = const PhosphorFlatIconData(0xe900, 'Bold');
  ...

  List<PhosphorFlatIconData> get icons => [addressBook, ...];
}

Exposing an icons getter with all the icons for that style would be extremely useful for dynamic features where all icons are needed, cause it's rather difficult for developers to keep track of which icons are being added, renamed, etc.