SfSymbol class

Renders an SF Symbol natively on iOS and macOS.

The default constructor draws the symbol in a single flat color. The named constructors select the other rendering modes the system supports:

SfSymbol(name: 'camera', color: Colors.blue, size: 40)
SfSymbol.hierarchical(name: 'square.stack.3d.up', color: Colors.blue, size: 40)
SfSymbol.palette(name: 'person.2', colors: [Colors.blue, Colors.pink], size: 40)
SfSymbol.multicolor(name: 'cloud.sun.rain.fill', size: 40)

Nothing is drawn while the symbol loads, or if no symbol named name exists on the running OS version.

Inheritance

Constructors

SfSymbol({Key? key, required String name, required double size, required Color color, FontWeight weight = FontWeight.normal, SfSymbolScale scale = SfSymbolScale.medium, double? variableValue, SfSymbolEffect? effect, bool effectRepeats = true, String? semanticLabel})
Draws the symbol in a single flat color.
const
SfSymbol.hierarchical({Key? key, required String name, required double size, required Color color, FontWeight weight = FontWeight.normal, SfSymbolScale scale = SfSymbolScale.medium, double? variableValue, SfSymbolEffect? effect, bool effectRepeats = true, String? semanticLabel})
Draws the symbol in color, applied at several opacities across its layers so its internal structure stays readable.
const
SfSymbol.multicolor({Key? key, required String name, required double size, Color? color, FontWeight weight = FontWeight.normal, SfSymbolScale scale = SfSymbolScale.medium, double? variableValue, SfSymbolEffect? effect, bool effectRepeats = true, String? semanticLabel})
Draws the symbol in its own built-in colors.
const
SfSymbol.palette({Key? key, required String name, required double size, required List<Color> colors, FontWeight weight = FontWeight.normal, SfSymbolScale scale = SfSymbolScale.medium, double? variableValue, SfSymbolEffect? effect, bool effectRepeats = true, String? semanticLabel})
Draws the symbol's layers in colors, in order.
const

Properties

color → Color?
The color for the monochrome and hierarchical modes.
final
colors → List<Color>?
The colors for the palette mode.
final
config → SfSymbolConfig
Everything that identifies the image this widget draws.
no setter
effect → SfSymbolEffect?
The animation to run, or null for a still symbol.
final
effectRepeats → bool
Whether effect repeats, or plays once when the symbol appears.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
name → String
The SF Symbol name, e.g. camera.aperture.
final
renderingMode → SfSymbolRenderingMode
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scale → SfSymbolScale
The symbol's size relative to size. See SfSymbolScale.
final
semanticLabel → String?
Describes the symbol to accessibility tools such as VoiceOver.
final
size → double
The symbol renders as roughly a size x size image, in logical pixels.
final
variableValue → double?
Fill level for variable symbols such as wifi, between 0.0 and 1.0.
final
weight → FontWeight
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<SfSymbol>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
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, int wrapWidth = 65}) → 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 ==(Object other) → bool
The equality operator.
inherited

Static Methods

effectSupport() → Future<SfSymbolEffectSupport>
Which SfSymbolEffects the running OS version can play.
isAvailable(String name) → Future<bool>
Whether a symbol named name exists on the running OS version.
precache(SfSymbolConfig config) → Future<void>
Renders a symbol ahead of time, so a widget showing it draws without the frame of empty space a first render would otherwise leave.