-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding AspectRatio And FittedBox Widget example
- Loading branch information
1 parent
aae312a
commit 3726d1a
Showing
3 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
examples/mirai_gallery/assets/json/aspect_ratio_example.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
42
examples/mirai_gallery/assets/json/fitted_box_example.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters