Skip to main content

CircleAvatar

The Stac CircleAvatar allows you to build a Flutter circle avatar widget using JSON. To know more about the circle avatar widget in Flutter, refer to the official documentation.

Properties​

PropertyTypeDescription
childMap<String, dynamic>?The widget to display inside the circle avatar.
backgroundColorString?The background color of the circle avatar.
backgroundImageString?The background image of the circle avatar.
foregroundImageString?The foreground image of the circle avatar.
onBackgroundImageErrorMap<String, dynamic>?The error widget to display if the background image fails to load.
onForegroundImageErrorMap<String, dynamic>?The error widget to display if the foreground image fails to load.
foregroundColorString?The color of the circle avatar's foreground elements.
radiusdouble?The radius of the circle avatar.
minRadiusdouble?The minimum radius of the circle avatar.
maxRadiusdouble?The maximum radius of the circle avatar.

Example JSON​

{
"type": "circleAvatar",
"backgroundColor": "#FF0000",
"foregroundColor": "#FFFFFF",
"backgroundImage": "https://raw.githubusercontent.com/StacDev/stac/refs/heads/dev/assets/companies/bettrdo.jpg",
"radius": 50,
"child": {
"type": "text",
"data": "A"
}
}