Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: added docs for mirai align widget #87

Merged
merged 1 commit into from
Jan 6, 2025
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
41 changes: 41 additions & 0 deletions website/docs/widgets/align.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Align

Mirai align allows you to build the Flutter align widget using JSON.
To know more about the align widget in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/widgets/Align-class.html).

## Properties

| Property | Type | Description |
| --- |-------------------|---------------------------------------------------|
| alignment | `MiraiAlignment` | How to align the child. |
| widthFactor | `double` | If non-null, sets its width to the child's width multiplied by this factor. |
| heightFactor | `double` | If non-null, sets its height to the child's height multiplied by this factor. |
| child | `Map<String,dynamic>` | The widget below this widget in the tree. |

## Example

```json
{
"type": "align",
"alignment": "topEnd",
"child": {
"type": "container",
"color": "#FC5632",
"clipBehavior": "hardEdge",
"height": 250,
"width": 200,
"child": {
"type": "align",
"alignment": "bottomCenter",
"child": {
"type": "text",
"data": "Flutter",
"style": {
"fontSize": 23,
"fontWeight": "w600"
}
}
}
}
}
```