Skip to content

Commit 0269f34

Browse files
Merge pull request #145 from BuildMirai/dv/CircleAvatar-docs
Docs: Add documentation for Mirai CircleAvatar widget
2 parents c3d8717 + da81cb6 commit 0269f34

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# CircleAvatar
2+
3+
The Mirai CircleAvatar allows you to build a Flutter circle avatar widget using JSON.
4+
To know more about the circle avatar widget in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/material/CircleAvatar-class.html).
5+
6+
## Properties
7+
8+
| Property | Type | Description |
9+
|-------------------------|-------------------------|-----------------------------------------------------------------------------|
10+
| child | `Map<String, dynamic>?` | The widget to display inside the circle avatar. |
11+
| backgroundColor | `String?` | The background color of the circle avatar. |
12+
| backgroundImage | `String?` | The background image of the circle avatar. |
13+
| foregroundImage | `String?` | The foreground image of the circle avatar. |
14+
| onBackgroundImageError | `Map<String, dynamic>?` | The error widget to display if the background image fails to load. |
15+
| onForegroundImageError | `Map<String, dynamic>?` | The error widget to display if the foreground image fails to load. |
16+
| foregroundColor | `String?` | The color of the circle avatar's foreground elements. |
17+
| radius | `double?` | The radius of the circle avatar. |
18+
| minRadius | `double?` | The minimum radius of the circle avatar. |
19+
| maxRadius | `double?` | The maximum radius of the circle avatar. |
20+
21+
## Example JSON
22+
23+
```json
24+
{
25+
"type": "circleAvatar",
26+
"backgroundColor": "#FF0000",
27+
"foregroundColor": "#FFFFFF",
28+
"backgroundImage": "https://raw.githubusercontent.com/BuildMirai/mirai/refs/heads/dev/assets/companies/bettrdo.jpg",
29+
"radius": 50,
30+
"child": {
31+
"type": "text",
32+
"data": "A"
33+
}
34+
}
35+
```

0 commit comments

Comments
 (0)