StacCircleAvatar class

A Stac model representing Flutter's CircleAvatar widget.

A circular widget typically used to represent a user with either an image, initials, or an icon. Supports configuring colors and radius.

{@tool snippet} Dart Example:

const StacCircleAvatar(
  backgroundColor: 'blue',
  foregroundColor: 'white',
  radius: 24,
  child: StacText(data: 'AB'),
)

{@end-tool}

{@tool snippet} JSON Example:

{
  "type": "circleAvatar",
  "backgroundColor": "blue",
  "foregroundColor": "white",
  "radius": 24,
  "child": {"type": "text", "data": "AB"}
}

{@end-tool}

See also:

Inheritance
Annotations
  • @JsonSerializable()

Constructors

StacCircleAvatar.new({StacWidget? child, StacColor? backgroundColor, String? backgroundImage, String? foregroundImage, StacColor? foregroundColor, double? radius, double? minRadius, double? maxRadius})
Creates a StacCircleAvatar with the given properties.
const
StacCircleAvatar.fromJson(Map<String, dynamic> json)
Creates a StacCircleAvatar from a JSON map.
factory

Properties

backgroundColor StacColor?
The fill color for the avatar's background.
final
backgroundImage String?
A URL for a background image.
final
child StacWidget?
The widget below this widget in the tree.
final
foregroundColor StacColor?
Default color for text and icons within the avatar.
final
foregroundImage String?
A URL for a foreground image (drawn on top of the background).
final
hashCode int
The hash code for this object.
no setterinherited
jsonData Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
maxRadius double?
The maximum radius for the avatar when using dynamic sizing.
final
minRadius double?
The minimum radius for the avatar when using dynamic sizing.
final
radius double?
Explicit radius for the avatar.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
Widget type identifier.
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this StacCircleAvatar instance to a JSON map.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited