Skip to content

Commit 3970c0d

Browse files
Merge pull request #93 from khanjasir90/khanjasir90/listtile_docs
feat: added docs for mirai list tile
2 parents 2c37dcb + b6cce5b commit 3970c0d

File tree

1 file changed

+131
-0
lines changed

1 file changed

+131
-0
lines changed

website/docs/widgets/list_tile.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# ListTile
2+
3+
Mirai list tile allows you to build the Flutter list tile widget using JSON.
4+
To know more about the list tile widget in Flutter, refer to the [official documentation](https://api.flutter.dev/flutter/material/ListTile-class.html).
5+
6+
## Properties
7+
8+
| Property | Type | Description |
9+
| --- |-------------------|---------------------------------------------------|
10+
| onTap | `Map<String,dynamic>` | Called when the user taps this list tile. |
11+
| onLongPress | `Map<String,dynamic>` | Called when the user long-presses on this list tile. |
12+
| leading | `Map<String,dynamic>` | A widget to display before the title. |
13+
| title | `Map<String,dynamic>` | The primary content of the list tile. |
14+
| subtitle | `Map<String,dynamic>` | Additional content displayed below the title. |
15+
| trailing | `Map<String,dynamic>` | A widget to display after the title. |
16+
| isThreeLine | `bool` | Whether this list tile is intended to display three lines of text. |
17+
| dense | `bool` | Whether this list tile is part of a vertically dense list. |
18+
| style | `ListTileStyle` | Defines the font used for the title. |
19+
| selectedColor | `String` | Defines the color used for icons and text when the list tile is selected. |
20+
| iconColor | `String` | Defines the default color for leading and trailing icons. |
21+
| textColor | `String` | Defines the text color for the title, subtitle, leading, and trailing. |
22+
| contentPadding | `MiraiEdgeInsets` | The tile's internal padding. |
23+
| enabled | `bool` | Whether this list tile is interactive. |
24+
| selected | `bool` | If this tile is also enabled then icons and text are rendered with the same color. |
25+
| focusColor | `String` | The color for the tile's Material when it has the input focus. |
26+
| hoverColor | `String` | The color for the tile's Material when a pointer is hovering over it. |
27+
| autoFocus | `String` | True if this widget will be selected as the initial focus when no other node in its scope is currently focused. |
28+
| tileColor | `String` | Defines the background color of ListTile when selected is false. |
29+
| selectedTileColor | `String` | Defines the background color of ListTile when selected is true. |
30+
| enableFeedback | `bool` | Whether detected gestures should provide acoustic and/or haptic feedback. |
31+
| horizontalTitleGap | `double` | The horizontal gap between the titles and the leading/trailing widgets. |
32+
| minVerticalPadding | `double` | The minimum padding on the top and bottom of the title and subtitle widgets. |
33+
| minLeadingWidth | `double` | The minimum width allocated for the ListTile.leading widget. |
34+
35+
## Example JSON
36+
37+
```json
38+
{
39+
"type": "column",
40+
"mainAxisAlignment": "start",
41+
"crossAxisAlignment": "center",
42+
"children": [
43+
{
44+
"type": "sizedBox",
45+
"height": 12
46+
},
47+
{
48+
"type": "listTile",
49+
"leading": {
50+
"type": "image",
51+
"src": "https://cdn-icons-png.flaticon.com/512/3135/3135715.png"
52+
},
53+
"title": {
54+
"type": "padding",
55+
"padding": {
56+
"top": 10
57+
},
58+
"child": {
59+
"type": "text",
60+
"data": "Andrew Symonds",
61+
"style": {
62+
"fontSize": 18
63+
}
64+
}
65+
},
66+
"subtitle": {
67+
"type": "padding",
68+
"padding": {
69+
"top": 10
70+
},
71+
"child": {
72+
"type": "text",
73+
"data": "Andrew Symonds was an Australian international cricketer, who played all three formats as a batting all-rounder. Commonly nicknamed \"Roy\", he was a key member of two World Cup winning squads. Symonds played as a right-handed, middle order batsman and alternated between medium pace and off-spin",
74+
"style": {
75+
"fontSize": 14
76+
}
77+
}
78+
},
79+
"trailing": {
80+
"type": "icon",
81+
"iconType": "material",
82+
"icon": "more_vert",
83+
"size": 24
84+
}
85+
},
86+
{
87+
"type": "sizedBox",
88+
"height": 12
89+
},
90+
{
91+
"type": "listTile",
92+
"leading": {
93+
"type": "image",
94+
"src": "https://cdn-icons-png.flaticon.com/512/3135/3135715.png"
95+
},
96+
"title": {
97+
"type": "padding",
98+
"padding": {
99+
"top": 10
100+
},
101+
"child": {
102+
"type": "text",
103+
"data": "Adam Gilchrist",
104+
"style": {
105+
"fontSize": 18
106+
}
107+
}
108+
},
109+
"subtitle": {
110+
"type": "padding",
111+
"padding": {
112+
"top": 10
113+
},
114+
"child": {
115+
"type": "text",
116+
"data": "Adam Craig Gilchrist is an Australian cricket commentator and former international cricketer and captain of the Australia national cricket team. He was an attacking left-handed batsman and record-breaking wicket-keeper",
117+
"style": {
118+
"fontSize": 14
119+
}
120+
}
121+
},
122+
"trailing": {
123+
"type": "icon",
124+
"iconType": "material",
125+
"icon": "more_vert",
126+
"size": 24
127+
}
128+
}
129+
]
130+
}
131+
```

0 commit comments

Comments
 (0)