Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions website/docs/widgets/circle_avatar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# CircleAvatar

The Mirai 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](https://api.flutter.dev/flutter/material/CircleAvatar-class.html).

## Properties

| Property | Type | Description |
|-------------------------|-------------------------|-----------------------------------------------------------------------------|
| child | `Map<String, dynamic>?` | The widget to display inside the circle avatar. |
| backgroundColor | `String?` | The background color of the circle avatar. |
| backgroundImage | `String?` | The background image of the circle avatar. |
| foregroundImage | `String?` | The foreground image of the circle avatar. |
| onBackgroundImageError | `Map<String, dynamic>?` | The error widget to display if the background image fails to load. |
| onForegroundImageError | `Map<String, dynamic>?` | The error widget to display if the foreground image fails to load. |
| foregroundColor | `String?` | The color of the circle avatar's foreground elements. |
| radius | `double?` | The radius of the circle avatar. |
| minRadius | `double?` | The minimum radius of the circle avatar. |
| maxRadius | `double?` | The maximum radius of the circle avatar. |

## Example JSON

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