Skip to content

Commit

Permalink
Adding AspectRatio And FittedBox Widget example
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedAbd0 committed Jan 17, 2025
1 parent aae312a commit 3726d1a
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 0 deletions.
39 changes: 39 additions & 0 deletions examples/mirai_gallery/assets/json/aspect_ratio_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "AspectRatio"
}
},
"body": {
"type": "padding",
"padding": {
"top": 12,
"left": 12,
"right": 12
},
"child": {
"type": "column",
"mainAxisAlignment": "start",
"crossAxisAlignment": "start",
"children": [
{
"type": "sizedBox",
"height": 12
},
{
"type": "aspectRatio",
"aspectRatio": 1.33,
"child": {
"type": "container",
"color": "#FF5733",
"width": 100,
"height": 100
}
}
]
}
}
}
42 changes: 42 additions & 0 deletions examples/mirai_gallery/assets/json/fitted_box_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "FittedBox"
}
},
"body": {
"type": "padding",
"padding": {
"top": 12,
"left": 12,
"right": 12
},
"child": {
"type": "column",
"mainAxisAlignment": "start",
"crossAxisAlignment": "start",
"children": [
{
"type": "sizedBox",
"height": 12
},
{
"type": "fittedBox",
"fit": "contain",
"alignment": "center",
"child": {
"type": "text",
"data": "Hello, World!",
"style": {
"fontSize": 20,
"color": "#000000"
}
}
}
]
}
}
}
67 changes: 67 additions & 0 deletions examples/mirai_gallery/assets/json/home_screen.json
Original file line number Diff line number Diff line change
Expand Up @@ -1629,6 +1629,73 @@
"behavior": "floating"
}
},

{
"type": "listTile",
"leading": {
"type": "icon",
"iconType": "material",
"icon": "apartment"
},

"title": {
"type": "text",
"data": "AspectRatio",
"style": {
"fontSize": 21
}
},
"subtitle": {
"type": "text",
"data": "A Material Design Mirai AspectRatio widget",
"style": {
"fontSize": 12
}
},
"isThreeLine": true,
"onTap": {
"actionType": "navigate",
"navigationStyle": "push",
"widgetJson": {
"type": "exampleScreen",
"assetPath": "assets/json/aspect_ratio_example.json"
}
}
},

{
"type": "listTile",
"leading": {
"type": "icon",
"iconType": "material",
"icon": "apartment"
},

"title": {
"type": "text",
"data": "FittedBox",
"style": {
"fontSize": 21
}
},
"subtitle": {
"type": "text",
"data": "A Material Design Mirai FittedBox widget",
"style": {
"fontSize": 12
}
},
"isThreeLine": true,
"onTap": {
"actionType": "navigate",
"navigationStyle": "push",
"widgetJson": {
"type": "exampleScreen",
"assetPath": "assets/json/fitted_box_example.json"
}
}
},

{
"type": "sizedBox",
"height": 24.0
Expand Down

0 comments on commit 3726d1a

Please sign in to comment.