Skip to content

Commit

Permalink
feat: add drawer example screen
Browse files Browse the repository at this point in the history
  • Loading branch information
vinothvino42 committed Jan 27, 2025
1 parent da6bcab commit 8473448
Show file tree
Hide file tree
Showing 2 changed files with 191 additions and 3 deletions.
160 changes: 160 additions & 0 deletions examples/mirai_gallery/assets/json/drawer_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "Appbar"
}
},
"drawer": {
"type": "drawer",
"child": {
"type": "listView",
"shrinkWrap": true,
"separator": {
"type": "container",
"height": 10
},
"children": [
{
"type": "listTile",
"leading": {
"type": "container",
"height": 50,
"width": 50,
"color": "#165FC7",
"child": {
"type": "column",
"mainAxisAlignment": "center",
"crossAxisAlignment": "center",
"children": [
{
"type": "text",
"data": "1",
"style": {
"fontSize": 21,
"color": "#FFFFFF"
}
}
]
}
},
"title": {
"type": "padding",
"padding": {
"top": 10
},
"child": {
"type": "text",
"data": "Item 1",
"style": {
"fontSize": 18
}
}
},
"subtitle": {
"type": "padding",
"padding": {
"top": 10
},
"child": {
"type": "text",
"data": "Item description",
"style": {
"fontSize": 14
}
}
},
"trailing": {
"type": "icon",
"iconType": "material",
"icon": "more_vert",
"size": 24
}
},
{
"type": "listTile",
"onPressed": {
"actionType": "navigate",
"navigationStyle": "pop"
},
"leading": {
"type": "container",
"height": 50,
"width": 50,
"color": "#165FC7",
"child": {
"type": "column",
"mainAxisAlignment": "center",
"crossAxisAlignment": "center",
"children": [
{
"type": "text",
"data": "2",
"style": {
"fontSize": 21,
"color": "#FFFFFF"
}
}
]
}
},
"title": {
"type": "padding",
"padding": {
"top": 10
},
"child": {
"type": "text",
"data": "Item 2",
"style": {
"fontSize": 18
}
}
},
"subtitle": {
"type": "padding",
"padding": {
"top": 10
},
"child": {
"type": "text",
"data": "Item description",
"style": {
"fontSize": 14
}
}
},
"trailing": {
"type": "icon",
"iconType": "material",
"icon": "more_vert",
"size": 24
}
}
]
}
},
"body": {
"type": "center",
"child": {
"type": "elevatedButton",
"child": {
"type": "text",
"data": "Open Drawer"
},
"style": {
"padding": {
"top": 8,
"left": 12,
"right": 12,
"bottom": 8
}
},
"onPressed": {
"actionType": "openDrawer"
}
}
}
}
34 changes: 31 additions & 3 deletions examples/mirai_gallery/assets/json/home_screen.json
Original file line number Diff line number Diff line change
Expand Up @@ -1588,8 +1588,6 @@
}
}
},


{
"type": "listTile",
"leading": {
Expand Down Expand Up @@ -1695,7 +1693,38 @@
}
}
},
{
"type": "listTile",
"leading": {
"type": "icon",
"iconType": "material",
"icon": "navigation"
},

"title": {
"type": "text",
"data": "Mirai Drawer",
"style": {
"fontSize": 21
}
},
"subtitle": {
"type": "text",
"data": "A Material Design Mirai Drawer widget",
"style": {
"fontSize": 12
}
},
"isThreeLine": true,
"onTap": {
"actionType": "navigate",
"navigationStyle": "push",
"widgetJson": {
"type": "exampleScreen",
"assetPath": "assets/json/drawer_example.json"
}
}
},
{
"type": "listTile",
"leading": {
Expand Down Expand Up @@ -1728,7 +1757,6 @@
}
}
},


{
"type": "sizedBox",
Expand Down

0 comments on commit 8473448

Please sign in to comment.