Skip to content

Commit 20b99aa

Browse files
Merge pull request #6 from BuildMirai/dv/row-spacing
feat: Add Row and Column Spacing
2 parents 2dce388 + 13e8295 commit 20b99aa

File tree

121 files changed

+2232
-641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2232
-641
lines changed

examples/mirai_gallery/assets/json/column_example.json

+41-197
Original file line numberDiff line numberDiff line change
@@ -8,218 +8,62 @@
88
}
99
},
1010
"body": {
11-
"type": "column",
12-
"mainAxisAlignment": "start",
13-
"crossAxisAlignment": "start",
14-
"children": [
15-
{
16-
"type": "sizedBox",
17-
"height": 12
18-
},
19-
{
20-
"type": "card",
21-
"elevation": 20,
22-
"borderOnForeground": true,
23-
"margin": {
24-
"top": 12,
25-
"bottom": 12,
26-
"right": 8,
27-
"left": 8
28-
},
29-
"child": {
30-
"type": "listTile",
31-
"leading": {
32-
"type": "image",
33-
"src": "https://images.pexels.com/photos/2115367/pexels-photo-2115367.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2"
34-
},
35-
"title": {
36-
"type": "padding",
37-
"padding": {
38-
"top": 10
39-
},
11+
"type": "singleChildScrollView",
12+
"child": {
13+
"type": "column",
14+
"mainAxisAlignment": "center",
15+
"crossAxisAlignment": "center",
16+
"spacing": 12,
17+
"children": [
18+
{
19+
"type": "container",
20+
"width": 2000,
21+
"height": 200,
22+
"color": "#FFCDD2",
23+
"child": {
24+
"type": "center",
4025
"child": {
4126
"type": "text",
42-
"data": "BURJ KHALIFA",
27+
"data": "Red Container",
4328
"style": {
44-
"fontSize": 18
29+
"color": "#B71C1C"
4530
}
4631
}
47-
},
48-
"subtitle": {
49-
"type": "padding",
50-
"padding": {
51-
"top": 10,
52-
"bottom": 10
53-
},
54-
"child": {
55-
"type": "column",
56-
"children": [
57-
{
58-
"type": "text",
59-
"data": "Get a chance to go on the top of Burj Khalifa.",
60-
"align": "center",
61-
"style": {
62-
"fontSize": 12
63-
}
64-
},
65-
{
66-
"type": "row",
67-
"children": [
68-
{
69-
"type": "outlinedButton",
70-
"style": {
71-
"padding": {
72-
"top": 8,
73-
"left": 12,
74-
"right": 12,
75-
"bottom": 8
76-
}
77-
},
78-
"onPressed": {},
79-
"child": {
80-
"type": "text",
81-
"data": "Explore",
82-
"align": "left",
83-
"style": {
84-
"fontSize": 12
85-
}
86-
}
87-
},
88-
{
89-
"type": "sizedBox",
90-
"width": 8
91-
},
92-
{
93-
"type": "outlinedButton",
94-
"style": {
95-
"padding": {
96-
"top": 8,
97-
"left": 12,
98-
"right": 12,
99-
"bottom": 8
100-
}
101-
},
102-
"onPressed": {},
103-
"child": {
104-
"type": "text",
105-
"data": "Share",
106-
"align": "center",
107-
"style": {
108-
"fontSize": 12
109-
}
110-
}
111-
}
112-
]
113-
}
114-
]
115-
}
11632
}
117-
}
118-
},
119-
{
120-
"type": "sizedBox",
121-
"height": 12
122-
},
123-
{
124-
"type": "card",
125-
"elevation": 20,
126-
"borderOnForeground": true,
127-
"margin": {
128-
"top": 12,
129-
"bottom": 12,
130-
"right": 8,
131-
"left": 8
13233
},
133-
"child": {
134-
"type": "listTile",
135-
"leading": {
136-
"type": "image",
137-
"src": "https://images.pexels.com/photos/7199830/pexels-photo-7199830.png?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2"
138-
},
139-
"title": {
140-
"type": "padding",
141-
"padding": {
142-
"top": 10
143-
},
34+
{
35+
"type": "container",
36+
"width": 2000,
37+
"height": 200,
38+
"color": "#C8E6C9",
39+
"child": {
40+
"type": "center",
14441
"child": {
14542
"type": "text",
146-
"data": "MUSEUM OF FUTURE",
43+
"data": "Green Container",
14744
"style": {
148-
"fontSize": 18
45+
"color": "#1B5E20"
14946
}
15047
}
151-
},
152-
"subtitle": {
153-
"type": "padding",
154-
"padding": {
155-
"top": 10,
156-
"bottom": 10
157-
},
48+
}
49+
},
50+
{
51+
"type": "container",
52+
"width": 2000,
53+
"height": 200,
54+
"color": "#BBDEFB",
55+
"child": {
56+
"type": "center",
15857
"child": {
159-
"type": "column",
160-
"children": [
161-
{
162-
"type": "text",
163-
"data": "Museum Of Future is open now.",
164-
"align": "center",
165-
"style": {
166-
"fontSize": 12
167-
}
168-
},
169-
{
170-
"type": "row",
171-
"children": [
172-
{
173-
"type": "outlinedButton",
174-
"style": {
175-
"padding": {
176-
"top": 8,
177-
"left": 12,
178-
"right": 12,
179-
"bottom": 8
180-
}
181-
},
182-
"onPressed": {},
183-
"child": {
184-
"type": "text",
185-
"data": "Explore",
186-
"align": "left",
187-
"style": {
188-
"fontSize": 12
189-
}
190-
}
191-
},
192-
{
193-
"type": "sizedBox",
194-
"width": 8
195-
},
196-
{
197-
"type": "outlinedButton",
198-
"style": {
199-
"padding": {
200-
"top": 8,
201-
"left": 12,
202-
"right": 12,
203-
"bottom": 8
204-
}
205-
},
206-
"onPressed": {},
207-
"child": {
208-
"type": "text",
209-
"data": "Share",
210-
"align": "center",
211-
"style": {
212-
"fontSize": 12
213-
}
214-
}
215-
}
216-
]
217-
}
218-
]
58+
"type": "text",
59+
"data": "Blue Container",
60+
"style": {
61+
"color": "#0D47A1"
62+
}
21963
}
22064
}
22165
}
222-
}
223-
]
66+
]
67+
}
22468
}
22569
}

examples/mirai_gallery/assets/json/row_example.json

+1-8
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,18 @@
2727
"type": "row",
2828
"mainAxisAlignment": "center",
2929
"crossAxisAlignment": "center",
30+
"spacing": 12,
3031
"children": [
3132
{
3233
"type": "image",
3334
"src": "https://images.pexels.com/photos/2718416/pexels-photo-2718416.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
3435
"width": 100
3536
},
36-
{
37-
"type": "sizedBox",
38-
"width": 12
39-
},
4037
{
4138
"type": "image",
4239
"src": "https://images.pexels.com/photos/121629/pexels-photo-121629.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",
4340
"width": 100
4441
},
45-
{
46-
"type": "sizedBox",
47-
"width": 12
48-
},
4942
{
5043
"type": "image",
5144
"src": "https://images.pexels.com/photos/1414642/pexels-photo-1414642.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2",

packages/mirai/lib/src/action_parsers/mirai_dialog_action/mirai_dialog_action.freezed.dart

+19-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ mixin _$MiraiDialogAction {
3030
TraversalEdgeBehavior? get traversalEdgeBehavior =>
3131
throw _privateConstructorUsedError;
3232

33+
/// Serializes this MiraiDialogAction to a JSON map.
3334
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
34-
@JsonKey(ignore: true)
35+
36+
/// Create a copy of MiraiDialogAction
37+
/// with the given fields replaced by the non-null parameter values.
38+
@JsonKey(includeFromJson: false, includeToJson: false)
3539
$MiraiDialogActionCopyWith<MiraiDialogAction> get copyWith =>
3640
throw _privateConstructorUsedError;
3741
}
@@ -65,6 +69,8 @@ class _$MiraiDialogActionCopyWithImpl<$Res, $Val extends MiraiDialogAction>
6569
// ignore: unused_field
6670
final $Res Function($Val) _then;
6771

72+
/// Create a copy of MiraiDialogAction
73+
/// with the given fields replaced by the non-null parameter values.
6874
@pragma('vm:prefer-inline')
6975
@override
7076
$Res call({
@@ -113,6 +119,8 @@ class _$MiraiDialogActionCopyWithImpl<$Res, $Val extends MiraiDialogAction>
113119
) as $Val);
114120
}
115121

122+
/// Create a copy of MiraiDialogAction
123+
/// with the given fields replaced by the non-null parameter values.
116124
@override
117125
@pragma('vm:prefer-inline')
118126
$MiraiNetworkRequestCopyWith<$Res>? get request {
@@ -156,6 +164,8 @@ class __$$MiraiDialogActionImplCopyWithImpl<$Res>
156164
$Res Function(_$MiraiDialogActionImpl) _then)
157165
: super(_value, _then);
158166

167+
/// Create a copy of MiraiDialogAction
168+
/// with the given fields replaced by the non-null parameter values.
159169
@pragma('vm:prefer-inline')
160170
@override
161171
$Res call({
@@ -275,7 +285,7 @@ class _$MiraiDialogActionImpl implements _MiraiDialogAction {
275285
other.traversalEdgeBehavior == traversalEdgeBehavior));
276286
}
277287

278-
@JsonKey(ignore: true)
288+
@JsonKey(includeFromJson: false, includeToJson: false)
279289
@override
280290
int get hashCode => Object.hash(
281291
runtimeType,
@@ -288,7 +298,9 @@ class _$MiraiDialogActionImpl implements _MiraiDialogAction {
288298
useSafeArea,
289299
traversalEdgeBehavior);
290300

291-
@JsonKey(ignore: true)
301+
/// Create a copy of MiraiDialogAction
302+
/// with the given fields replaced by the non-null parameter values.
303+
@JsonKey(includeFromJson: false, includeToJson: false)
292304
@override
293305
@pragma('vm:prefer-inline')
294306
_$$MiraiDialogActionImplCopyWith<_$MiraiDialogActionImpl> get copyWith =>
@@ -334,8 +346,11 @@ abstract class _MiraiDialogAction implements MiraiDialogAction {
334346
bool get useSafeArea;
335347
@override
336348
TraversalEdgeBehavior? get traversalEdgeBehavior;
349+
350+
/// Create a copy of MiraiDialogAction
351+
/// with the given fields replaced by the non-null parameter values.
337352
@override
338-
@JsonKey(ignore: true)
353+
@JsonKey(includeFromJson: false, includeToJson: false)
339354
_$$MiraiDialogActionImplCopyWith<_$MiraiDialogActionImpl> get copyWith =>
340355
throw _privateConstructorUsedError;
341356
}

0 commit comments

Comments
 (0)