From 101c0dde59dc2d202e8da55360a1347195687c4f Mon Sep 17 00:00:00 2001 From: Mohd Jasir Khan Date: Mon, 6 Jan 2025 17:30:38 +0530 Subject: [PATCH] feat: added docs for mirai align widget --- website/docs/widgets/align.md | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 website/docs/widgets/align.md diff --git a/website/docs/widgets/align.md b/website/docs/widgets/align.md new file mode 100644 index 00000000..15f7b328 --- /dev/null +++ b/website/docs/widgets/align.md @@ -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` | 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" + } + } + } + } +} +``` \ No newline at end of file