Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 08daef7

Browse files
布局
1 parent eec1435 commit 08daef7

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

‎example/lib/main.dart

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,46 @@ showAlertDialog(BuildContext context) {
5252
}),
5353
],
5454
),
55-
Text("2、gravity"),
55+
Text("2、dialog gravity"),
5656
Row(
5757
children: <Widget>[
5858
makeTextButton("bottom", () {
59-
YYAlertDialogWithGravity(context, null, Gravity.bottom);
59+
YYAlertDialogWithGravity(
60+
context: context,
61+
gravity: Gravity.bottom,
62+
);
6063
}),
6164
makeTextButton("top", () {
62-
YYAlertDialogWithGravity(context, null, Gravity.top);
65+
YYAlertDialogWithGravity(
66+
context: context,
67+
gravity: Gravity.top,
68+
);
6369
}),
6470
makeTextButton("left", () {
65-
YYAlertDialogWithGravity(context, 250.0, Gravity.left);
71+
YYAlertDialogWithGravity(
72+
context: context,
73+
width: 250.0,
74+
gravity: Gravity.left,
75+
);
6676
}),
6777
makeTextButton("right", () {
68-
YYAlertDialogWithGravity(context, 250.0, Gravity.right);
78+
YYAlertDialogWithGravity(
79+
context: context,
80+
width: 250.0,
81+
gravity: Gravity.right,
82+
);
6983
}),
7084
],
7185
),
86+
Text("3、double button gravity"),
87+
Row(
88+
children: <Widget>[
89+
makeTextButton("bottom", () {}),
90+
makeTextButton("top", () {}),
91+
makeTextButton("left", () {}),
92+
makeTextButton("right", () {}),
93+
],
94+
),
7295
],
7396
),
7497
);

‎lib/components/alert_dialog.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ YYDialog YYAlertDialogHeadAndBody(BuildContext context) {
6464
..show();
6565
}
6666

67-
YYDialog YYAlertDialogWithGravity([context, width, gravity]) {
67+
YYDialog YYAlertDialogWithGravity({context, width, gravity}) {
6868
return YYDialog().build(context)
6969
..width = width
7070
..gravity = gravity

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /