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
Available extensions
Annotations
  • @JsonSerializable.new()

Constructors

StacCircleAvatar({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 → StacColor?
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 → StacColor?
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
parse(BuildContext context) → Widget?

Available on StacWidget?, provided by the StacWidgetParser extension

parsePreferredSizeWidget(BuildContext context) → PreferredSizeWidget?

Available on StacWidget?, provided by the StacWidgetParser extension

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