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

The Mirai Filled Button allows you to build a Flutter filled button widget using JSON.
To know more about the filled button widget in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/material/FilledButton-class.html).

## Properties

| Property | Type | Description |
|----------------|-------------------------|------------------------------------------------------------------------------------|
| onPressed | `Map<String, dynamic>?` | The callback that is called when the button is tapped. |
| onLongPress | `Map<String, dynamic>?` | The callback that is called when the button is long-pressed. |
| onHover | `Map<String, dynamic>?` | The callback that is called when the button is hovered over. |
| onFocusChange | `Map<String, dynamic>?` | The callback that is called when the button's focus changes. |
| style | `MiraiButtonStyle?` | The style to apply to the button. |
| autofocus | `bool` | Whether the button should be focused when the page is loaded. Defaults to `false`. |
| clipBehavior | `Clip` | Determines how the content should be clipped. Defaults to `Clip.none`. |
| child | `Map<String, dynamic>` | The widget to display inside the button. |

## Example JSON

```json
{
"type": "filledButton",
"onPressed": {},
"onLongPress": {},
"onHover": {},
"onFocusChange": {},
"style": {
"backgroundColor": "#FFC107",
"foregroundColor": "#000000"
},
"autofocus": false,
"clipBehavior": "none",
"child": {
"type": "text",
"data": "Click Me!"
}
}
```