Skip to content

Commit

Permalink
Add Mirai grid view example to the gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
divyanshub024 committed Feb 24, 2024
1 parent d938d60 commit 033da5b
Show file tree
Hide file tree
Showing 2 changed files with 258 additions and 0 deletions.
227 changes: 227 additions & 0 deletions examples/mirai_gallery/assets/json/grid_view_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
{
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "Grid View Example"
}
},
"body": {
"type": "padding",
"padding": {
"left": 10,
"top": 10,
"right": 10,
"bottom": 10
},
"child": {
"type": "gridView",
"crossAxisCount": 2,
"crossAxisSpacing": 10.0,
"mainAxisSpacing": 10.0,
"children": [
{
"type": "container",
"decoration": {
"type": "boxDecoration",
"color": "#FFCDD2",
"borderRadius": {
"all": 8.0
}
},
"child": {
"type": "center",
"child": {
"type": "text",
"data": "Item 1",
"style": {
"color": "#B71C1C"
}
}
}
},
{
"type": "container",
"decoration": {
"type": "boxDecoration",
"color": "#C8E6C9",
"borderRadius": {
"all": 8.0
}
},
"child": {
"type": "center",
"child": {
"type": "text",
"data": "Item 2",
"style": {
"color": "#1B5E20"
}
}
}
},
{
"type": "container",
"decoration": {
"type": "boxDecoration",
"color": "#BBDEFB",
"borderRadius": {
"all": 8.0
}
},
"child": {
"type": "center",
"child": {
"type": "text",
"data": "Item 3",
"style": {
"color": "#0D47A1"
}
}
}
},
{
"type": "container",
"decoration": {
"type": "boxDecoration",
"color": "#FFF9C4",
"borderRadius": {
"all": 8.0
}
},
"child": {
"type": "center",
"child": {
"type": "text",
"data": "Item 4",
"style": {
"color": "#F57F17"
}
}
}
},
{
"type": "container",
"decoration": {
"type": "boxDecoration",
"color": "#FFCCBC",
"borderRadius": {
"all": 8.0
}
},
"child": {
"type": "center",
"child": {
"type": "text",
"data": "Item 5",
"style": {
"color": "#BF360C"
}
}
}
},
{
"type": "container",
"decoration": {
"type": "boxDecoration",
"color": "#B2EBF2",
"borderRadius": {
"all": 8.0
}
},
"child": {
"type": "center",
"child": {
"type": "text",
"data": "Item 6",
"style": {
"color": "#006064"
}
}
}
},
{
"type": "container",
"decoration": {
"type": "boxDecoration",
"color": "#F8BBD0",
"borderRadius": {
"all": 8.0
}
},
"child": {
"type": "center",
"child": {
"type": "text",
"data": "Item 7",
"style": {
"color": "#880E4F"
}
}
}
},
{
"type": "container",
"decoration": {
"type": "boxDecoration",
"color": "#D1C4E9",
"borderRadius": {
"all": 8.0
}
},
"child": {
"type": "center",
"child": {
"type": "text",
"data": "Item 8",
"style": {
"color": "#311B92"
}
}
}
},
{
"type": "container",
"decoration": {
"type": "boxDecoration",
"color": "#C5CAE9",
"borderRadius": {
"all": 8.0
}
},
"child": {
"type": "center",
"child": {
"type": "text",
"data": "Item 9",
"style": {
"color": "#1A237E"
}
}
}
},
{
"type": "container",
"decoration": {
"type": "boxDecoration",
"color": "#FFE0B2",
"borderRadius": {
"all": 8.0
}
},
"child": {
"type": "center",
"child": {
"type": "text",
"data": "Item 10",
"style": {
"color": "#E65100"
}
}
}
}
]
}
}
}
31 changes: 31 additions & 0 deletions examples/mirai_gallery/assets/json/home_screen.json
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,37 @@
}
}
},
{
"type": "listTile",
"leading": {
"type": "icon",
"iconType": "material",
"icon": "grid_view"
},
"title": {
"type": "text",
"data": "Mirai GridView",
"style": {
"fontSize": 21
}
},
"subtitle": {
"type": "text",
"data": "A scrollable, 2D array of widgets that are created on demand.",
"style": {
"fontSize": 12
}
},
"isThreeLine": true,
"onTap": {
"actionType": "navigate",
"navigationStyle": "push",
"widgetJson": {
"type": "exampleScreen",
"assetPath": "assets/json/grid_view_example.json"
}
}
},
{
"type": "listTile",
"leading": {
Expand Down

0 comments on commit 033da5b

Please sign in to comment.