[Proposal]Support for rectangular icons #99830
Labels
c: new feature
Nothing broken; request for a new capability
c: proposal
A detailed proposal for a change to Flutter
f: material design
flutter/packages/flutter/material repository.
framework
flutter/packages/flutter repository. See also f: labels.
team-design
Owned by Design Languages team
triaged-design
Triaged by Design Languages team
Use case
Currently, flutter only supports square icons.
Icon
creates aSizedBox
with equal width and height.Packages like font_awesome_flutter, which contain rectangular icons, have to reimplement the
Icon
class and change the line where flutter defines theSizedBox
.This leads to a lot of duplicate code, unnecessary maintenance costs, unexpected behavior for developers, and slow adaptation of new features added to
Icon
.Related issues: fluttercommunity/font_awesome_flutter#132, fluttercommunity/font_awesome_flutter#204, fluttercommunity/font_awesome_flutter#201, fluttercommunity/font_awesome_flutter#198
Proposal
There are multiple possible solutions:
IconData
which is then used to scale theIcon
width accordinglyIcon
which sets the icon dimensions (would keepFaIcon
in font_awesome_flutter)Automatically obtain icon dimensions usingIntrinsicWidth
/IntrinsicHeight
(costly)The text was updated successfully, but these errors were encountered: