icon 0.1.0+1 copy "icon: ^0.1.0+1" to clipboard
icon: ^0.1.0+1 copied to clipboard

outdated

An extended Icon for those that are not actually square. Plus shadows support!

🙋‍♂️ I'm an Icon Too! #

An extended Icon for those that are not actually square. Plus shadows support! #

Screenshot preview of Icon Example app

... because Flutter's native [Icon] "assumes that the rendered icon is squared" and that "non-squared icons may render incorrectly."

IconToo(IconData icon, {@required Size trueSize, Color color})

Builds an [Icon] set inside a [SizedBox] constrained by [trueSize], with given data [icon] and optionally passing [color].

✨ As a bonus, [IconToo] supports the shadows parameter from [TextStyle], passed as List<Shadow> and rendered under an [IconToo].

  • See [Shadow] for more information.

Example usage with an [IconButton]: #

IconButton(
  icon: IconToo(
    color: Colors.red,
    CustomIcons.non_square_icon,
    // IconToo passes `fontSize = min(trueSize.width, trueSize.height)` to `TextStyle()`
    trueSize: Size(34.0 * 5, 34.0),
  ),
  // But we need the max() to ensure an IconButton has a diameter that encompasses the entire IconToo
  iconSize: 34.0 * 5,
  onPressed: () {},
);

Icon Example app #

See some example usage of the Icon package for Flutter included here.

11
likes
30
pub points
82%
popularity

Publisher

verified publisherzaba.app

An extended Icon for those that are not actually square. Plus shadows support!

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on icon