Fluent2Avatar class
Fluent 2's Avatar: a person (or a group, with Fluent2AvatarShape.square) as their picture (image), else the initials of name (or initials) in the size's type, else the person glyph; coloured by color; with a presence badge at its bottom end, and the brand ring while selected. size is one of Fluent's (16 to 128, 32 by default). Read as an image named name and its presence; with onPressed a button.
Fluent2Avatar(name: 'Ines Duarte', color: Fluent2AvatarColor.colorful, presence: Fluent2Presence.available)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- Fluent2Avatar
Constructors
-
Fluent2Avatar({String? name, String? initials, ImageProvider<
Object> ? image, double size = 32, Fluent2AvatarShape shape = Fluent2AvatarShape.circular, Fluent2AvatarColor color = Fluent2AvatarColor.neutral, Fluent2Presence? presence, bool selected = false, VoidCallback? onPressed, String? label, IconData? icon, FocusNode? focusNode, bool autofocus = false, Fluent2Style? style, Key? key}) -
An avatar of
name: its picture, or its initials.const
Properties
- autofocus → bool
-
Whether the control takes focus when it first builds.
final
- color → Fluent2AvatarColor
-
Fluent's
color: the fill behind the initials.final - focusNode → FocusNode?
-
The control's focus node; null makes and disposes its own.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
The glyph drawn with neither picture nor initials; null is the
person (or the people, for a square group).
final
-
image
→ ImageProvider<
Object> ? -
The picture; null draws the initials.
final
- initials → String?
-
The letters shown; null takes them from name.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String?
-
What a screen reader says with onPressed; null says name.
final
- name → String?
-
The person's (or the group's) name: spoken, and the initials' source.
final
- onPressed → VoidCallback?
-
What a press does (open the profile); null is a picture.
final
- presence → Fluent2Presence?
-
The presence badge; null draws none.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selected → bool
-
The brand ring of a person who is active (speaking, sharing).
final
- shape → Fluent2AvatarShape
-
Fluent's
shape: circular for a person, square for a group or an app.final - size → double
-
The side, in pixels (Fluent's 16, 20, 24, 28, 32, 36, 40, 48, 56, 64,
72, 96, 120 or 128).
final
- style → Fluent2Style?
-
This avatar's own look, slot by slot, over its component theme
(Fluent2ThemeData.avatarTheme): the slots its doc names.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
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 -
Add additional properties associated with the node.
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, 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
-
badgeOf(
double size) → double -
The badge's diameter at
size, Fluent'sgetBadgeSize: 6 under 28, 10 to 40, 12 to 56, 16 to 64, 20 to 96, 28 above. -
squareRadius(
double size) → double -
A square avatar's corner at
size, Fluent's: 2 to 24, 4 to 48, 6 to 72, 8 above. -
typeOf(
Fluent2ThemeData t, double size) → TextStyle -
The initials' type at
size, Fluent's: caption2Strong to 24, caption1Strong to 28, body1Strong to 40, subtitle2 to 56, subtitle1 to 96, title3 above.