IconToo class

🙋‍♂️ I'm an Icon Too!

An extended Icon "too" for those that are not actually square, because Flutter's native Icon "assumes that the rendered icon is squared", plus 👥 shadows support.

const IconToo(icon, {key, trueSize?, sizeX?, sizeY?, color?, shadows?, alignment?, semanticLabel?, textDirection?})

Builds an Icon-akin widget set inside a SizedBox of sizeX and sizeY with given icon data.

Customize with 🎨 color, which defaults to IconTheme.of, or optional 👥 shadows, a List<Shadow> like TextStyle.shadows.

The AlignmentGeometry and textDirection are handled, but may be overridden if necessary.

Assumed to be wide, super Icon.size is assigned _sizeX ?? _sizeY.

  • This affects situations that look for an Icon.size, like IconButton
  • A solution for taller icons exists: IconToo.tall
    • Where the only difference is the order of assignment to Icon.size: _sizeY ?? _sizeX

Replete with proper Semantics and debug Propertys.

NOTE: All the boxes are checked as far as the parameters for which a standard Icon looks and the accessibility & debug features they offer.

SEE ALSO: Icon, for a description on what an "Icon" is and some requirements to deploy that Widget or an 🙋‍♂️ IconToo.

Inheritance
Available Extensions

Constructors

IconToo(IconData? icon, {Key? key, @Deprecated(_DEPRECATED) Size? trueSize, double? sizeX, double? sizeY, Color? color, List<Shadow>? shadows, AlignmentGeometry? alignment, String? semanticLabel, TextDirection? textDirection})
🙋‍♂️ I'm an Icon Too!
const
IconToo.tall(IconData? icon, {Key? key, @Deprecated(_DEPRECATED) Size? trueSize, double? sizeX, double? sizeY, Color? color, List<Shadow>? shadows, AlignmentGeometry? alignment, String? semanticLabel, TextDirection? textDirection})
🙋‍♂️ I'm an Icon Too!
const

Properties

alignment AlignmentGeometry?
🔛 This IconToo will side-align its glyph according to ambient or assigned textDirection.
final
applyTextScaling bool?
Whether to scale the size of this widget using the ambient MediaQuery's TextScaler.
finalinherited
asSize Size
🧮 Returns this IconToo's size as a Size with width equal to sizeX, or 0.0 if null, and height equal to sizeY, or 0.0 if null.
no setter
color Color?
🎨 Color with which to draw this icon glyph.
final
fill double?
The fill for drawing the icon.
finalinherited
grade double?
The grade (granular stroke weight) for drawing the icon.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
icon IconData?
🆔 The icon data to display.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
opticalSize double?
The optical size for drawing the icon.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel String?
💬 This label is announced with accessibility modes active (such as TalkBack or VoiceOver) but not shown in the UI.
final
shadows List<Shadow>?
👥 This IconToo may have shadows rendered underneath like TextStyle.
final
size double?
The size of the icon in logical pixels.
finalinherited
sizeX double?
🧮 Horizontal size, or width, in logical pixels to provide as space for this IconToo. Gets _sizeX if assigned. May be null.
no setter
sizeY double?
🧮 Vertical size, or height, in logical pixels to provide as space for this IconToo. Gets _sizeY if assigned. May be null.
no setter
textDirection TextDirection?
🔚 The text direction to use when rendering this IconToo.
final
weight double?
The stroke weight for drawing the icon.
finalinherited

Methods

build(BuildContext context) Widget
👷‍♂️ Method responsible for laying-out and rendering an IconToo, unique from an Icon in that icon may be non-square and shadows parameter is accepted.
override
copyWith({Key? key, IconData? icon, Size? trueSize, double? sizeX, double? sizeY, Color? color, List<Shadow>? shadows, AlignmentGeometry? alignment, String? semanticLabel, TextDirection? textDirection}) IconToo
  • 👆 operator >(VoidCallback onTap)IconButton 📋 Return an IconToo with fields that mirror this except for the parameters given with this method.
  • createElement() StatelessElement
    Creates a StatelessElement to manage this widget's location in the tree.
    inherited
    debugDescribeChildren() List<DiagnosticsNode>
    Returns a list of DiagnosticsNode objects describing this node's children.
    inherited
    debugFillProperties(DiagnosticPropertiesBuilder properties) → void
    👨‍💻 Adds width and height to existing Icon props.
    override
    noSuchMethod(Invocation invocation) → dynamic
    Invoked when a nonexistent method or property is accessed.
    inherited
    toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
    Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
    inherited
    toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
    A string representation of this object.
    inherited
    toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
    Returns a string representation of this node and its descendants.
    inherited
    toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
    Returns a one-line detailed description of the object.
    inherited
    toStringShort() String
    A short, textual description of this widget.
    inherited

    Operators

    operator %(dynamic modulation) IconToo
    💥 "Modulate" this IconToo
    operator &(dynamic padding) Widget
    🧦 "And" this IconToo
    operator *(dynamic operation) IconToo
    ❌ "Multiply" this IconToo Randomly
    operator +(dynamic inflation) IconToo
    ➕ "Add" to this IconToo
    operator -(dynamic deflation) IconToo
    ➖ "Subtract" from this IconToo
    operator ==(Object other) bool
    The equality operator.
    inherited
    operator >(VoidCallback onTap) IconButton
    👆 "Chevron" this IconToo