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
30 changes: 30 additions & 0 deletions website/docs/widgets/padding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Padding

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

## Properties

| Property | Type | Description |
| --- |-------------------|---------------------------------------------------|
| padding | `MiraiEdgeInsets` | The amount of space by which to inset the child. Examples: `"padding": 12` for uniform padding, `"padding": {"left": 0, "right": 0}` for specific sides, or `{"padding": [8, 12, 8, 12]}` for left, top, right, bottom. |
| child | `Map<String,dynamic>` | The widget below this widget in the tree. |

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @khanjasir90, In note or description can we also mention other ways to give padding?

  1. All padding: {"padding": 12}
  2. Padding fromLTRB: {"padding": [8, 12, 8, 12]}.

## Example JSON

```json
{
"type": "padding",
"padding": {
"left": 0,
"right": 0
},
"child": {
"type": "container",
"color": "#672BFF",
"clipBehavior": "hardEdge",
"height": 75,
"width": 700
}
}
```