Skip to content

Commit 8dcbdd9

Browse files
Merge pull request #141 from BuildMirai/dv/flexible-docs
docs: Add documentation for the flexible widget
2 parents f629f29 + 30a5e91 commit 8dcbdd9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

website/docs/widgets/flexible.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Flexible
2+
3+
The Mirai Flexible allows you to build a Flutter flexible widget using JSON.
4+
To know more about the flexible widget in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/widgets/Flexible-class.html).
5+
6+
## Properties
7+
8+
| Property | Type | Description |
9+
|----------|-------------------------|------------------------------------------------------------------------------------------|
10+
| child | `Map<String, dynamic>?` | The widget to display inside the flexible widget. |
11+
| flex | `int` | The flex factor to use for the flexible widget. Defaults to `1`. |
12+
| fit | `FlexFit` | How the child should be inscribed into the available space. Defaults to `FlexFit.loose`. |
13+
14+
## Example JSON
15+
16+
```json
17+
{
18+
"type": "flexible",
19+
"flex": 2,
20+
"fit": "tight",
21+
"child": {
22+
"type": "text",
23+
"data": "Hello, World!"
24+
}
25+
}
26+
```

0 commit comments

Comments
 (0)