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 0052360

Browse files
εΈƒε±€
1 parent a18ac09 commit 0052360

File tree

8 files changed

+274
-202
lines changed

8 files changed

+274
-202
lines changed

β€Ž.idea/workspace.xml

Lines changed: 170 additions & 89 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€ŽREADME.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# flutter_custom_dialog
2-
Custom Dialog.
2+
3+
Creating......
34

45
## Getting Started
56

β€Žexample/lib/main.dart

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
library flutter_custom_dialog;
22

33
import 'package:flutter/material.dart';
4-
import 'package:flutter_custom_dialog/components/dialog.dart';
4+
import 'package:flutter_custom_dialog/components/alert_dialog.dart';
5+
import 'package:flutter_custom_dialog/components/listview_dialog.dart';
56

67
void main() => runApp(MyApp());
78

@@ -22,7 +23,6 @@ class AppHome extends StatelessWidget {
2223
child: Column(
2324
children: <Widget>[
2425
showAlertDialog(context),
25-
showListTileDialog(context),
2626
showListViewDialog(context),
2727
],
2828
),
@@ -53,22 +53,6 @@ showAlertDialog(BuildContext context) {
5353
);
5454
}
5555

56-
showListTileDialog(BuildContext context) {
57-
return Column(
58-
crossAxisAlignment: CrossAxisAlignment.start,
59-
children: <Widget>[
60-
Text("YYListTileDialog:"),
61-
Row(
62-
children: <Widget>[
63-
makeTextButton("1", () {
64-
YYListTileDialog1(context);
65-
}),
66-
],
67-
),
68-
],
69-
);
70-
}
71-
7256
showListViewDialog(BuildContext context) {
7357
return Column(
7458
crossAxisAlignment: CrossAxisAlignment.start,
@@ -79,6 +63,9 @@ showListViewDialog(BuildContext context) {
7963
makeTextButton("1", () {
8064
YYListViewDialog1(context);
8165
}),
66+
makeTextButton("2", () {
67+
YYListViewDialog2(context);
68+
}),
8269
],
8370
),
8471
],

β€Žexample/pubspec.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Generated by pub
2-
# See https://dart.dev/tools/pub/glossary#lockfile
2+
# See https://www.dartlang.org/tools/pub/glossary#lockfile
33
packages:
44
async:
55
dependency: transitive
66
description:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.2.0"
10+
version: "2.1.0"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
@@ -80,14 +80,14 @@ packages:
8080
name: pedantic
8181
url: "https://pub.dartlang.org"
8282
source: hosted
83-
version: "1.7.0"
83+
version: "1.5.0"
8484
quiver:
8585
dependency: transitive
8686
description:
8787
name: quiver
8888
url: "https://pub.dartlang.org"
8989
source: hosted
90-
version: "2.0.3"
90+
version: "2.0.2"
9191
sky_engine:
9292
dependency: transitive
9393
description: flutter
@@ -134,7 +134,7 @@ packages:
134134
name: test_api
135135
url: "https://pub.dartlang.org"
136136
source: hosted
137-
version: "0.2.5"
137+
version: "0.2.4"
138138
typed_data:
139139
dependency: transitive
140140
description:
@@ -150,4 +150,4 @@ packages:
150150
source: hosted
151151
version: "2.0.8"
152152
sdks:
153-
dart: ">=2.2.2 <3.0.0"
153+
dart: ">=2.2.0 <3.0.0"

β€Žlib/components/alert_dialog.dart

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import 'package:flutter/material.dart';
2+
3+
import '../flutter_custom_dialog.dart';
4+
5+
YYDialog YYAlertDialog1(BuildContext context) {
6+
return YYDialog().build(context)
7+
..width = 240
8+
..borderRadius = 4.0
9+
..text(
10+
padding: EdgeInsets.all(18.0),
11+
text: "Dialog header",
12+
color: Colors.black,
13+
fontSize: 18.0,
14+
fontWeight: FontWeight.w500,
15+
)
16+
..text(
17+
padding: EdgeInsets.only(left: 18.0, right: 18.0),
18+
text: "Dialog body text",
19+
color: Colors.grey[500],
20+
)
21+
..doubleButton(
22+
padding: EdgeInsets.only(top: 24.0),
23+
mainAxisAlignment: MainAxisAlignment.end,
24+
text1: "ACTION 1",
25+
color1: Colors.deepPurpleAccent,
26+
fontSize1: 14.0,
27+
text2: "ACTION 2",
28+
color2: Colors.deepPurpleAccent,
29+
fontSize2: 14.0,
30+
)
31+
..show();
32+
}
33+
34+
YYDialog YYAlertDialog2(BuildContext context) {
35+
return YYDialog().build(context)
36+
..width = 240
37+
..borderRadius = 4.0
38+
..text(
39+
padding: EdgeInsets.all(18.0),
40+
text: "Discard draft?",
41+
color: Colors.grey[700],
42+
)
43+
..doubleButton(
44+
padding: EdgeInsets.only(top: 10.0),
45+
mainAxisAlignment: MainAxisAlignment.end,
46+
text1: "CANCEL",
47+
color1: Colors.deepPurpleAccent,
48+
fontSize1: 14.0,
49+
fontWeight1: FontWeight.bold,
50+
text2: "DISCARD",
51+
color2: Colors.deepPurpleAccent,
52+
fontSize2: 14.0,
53+
fontWeight2: FontWeight.bold,
54+
)
55+
..show();
56+
}
57+
58+
YYDialog YYAlertDialog3(BuildContext context) {
59+
return YYDialog().build(context)
60+
..width = 260
61+
..borderRadius = 4.0
62+
..text(
63+
padding: EdgeInsets.all(18.0),
64+
text: "Use location service?",
65+
color: Colors.black,
66+
fontSize: 18.0,
67+
fontWeight: FontWeight.w500,
68+
)
69+
..text(
70+
padding: EdgeInsets.only(left: 18.0, right: 18.0),
71+
text:
72+
"Let us help apps determine location. This means sending anonymous location data to us, even when no apps are running.",
73+
color: Colors.grey[500],
74+
fontSize: 15.0,
75+
)
76+
..doubleButton(
77+
padding: EdgeInsets.only(top: 24.0),
78+
mainAxisAlignment: MainAxisAlignment.end,
79+
text1: "DISAGREE",
80+
color1: Colors.deepPurpleAccent,
81+
fontSize1: 14.0,
82+
text2: "AGREE",
83+
color2: Colors.deepPurpleAccent,
84+
fontSize2: 14.0,
85+
)
86+
..show();
87+
}
File renamed without changes.

β€Žlib/components/dialog.dart renamed to β€Žlib/components/listview_dialog.dart

Lines changed: 3 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,7 @@
11
import 'package:flutter/material.dart';
2+
import 'package:flutter_custom_dialog/components/bean/dialog_item.dart';
23

34
import '../flutter_custom_dialog.dart';
4-
import 'dialog_item.dart';
5-
6-
YYDialog YYAlertDialog1(BuildContext context) {
7-
return YYDialog().build(context)
8-
..width = 240
9-
..borderRadius = 4.0
10-
..text(
11-
padding: EdgeInsets.all(18.0),
12-
text: "Dialog header",
13-
color: Colors.black,
14-
fontSize: 18.0,
15-
fontWeight: FontWeight.w500,
16-
)
17-
..text(
18-
padding: EdgeInsets.only(left: 18.0, right: 18.0),
19-
text: "Dialog body text",
20-
color: Colors.grey[500],
21-
)
22-
..doubleButton(
23-
padding: EdgeInsets.only(top: 24.0),
24-
mainAxisAlignment: MainAxisAlignment.end,
25-
text1: "ACTION 1",
26-
color1: Colors.deepPurpleAccent,
27-
fontSize1: 14.0,
28-
text2: "ACTION 2",
29-
color2: Colors.deepPurpleAccent,
30-
fontSize2: 14.0,
31-
)
32-
..show();
33-
}
34-
35-
YYDialog YYAlertDialog2(BuildContext context) {
36-
return YYDialog().build(context)
37-
..width = 240
38-
..borderRadius = 4.0
39-
..text(
40-
padding: EdgeInsets.all(18.0),
41-
text: "Discard draft?",
42-
color: Colors.grey[700],
43-
)
44-
..doubleButton(
45-
padding: EdgeInsets.only(top: 10.0),
46-
mainAxisAlignment: MainAxisAlignment.end,
47-
text1: "CANCEL",
48-
color1: Colors.deepPurpleAccent,
49-
fontSize1: 14.0,
50-
fontWeight1: FontWeight.bold,
51-
text2: "DISCARD",
52-
color2: Colors.deepPurpleAccent,
53-
fontSize2: 14.0,
54-
fontWeight2: FontWeight.bold,
55-
)
56-
..show();
57-
}
58-
59-
YYDialog YYAlertDialog3(BuildContext context) {
60-
return YYDialog().build(context)
61-
..width = 260
62-
..borderRadius = 4.0
63-
..text(
64-
padding: EdgeInsets.all(18.0),
65-
text: "Use location service?",
66-
color: Colors.black,
67-
fontSize: 18.0,
68-
fontWeight: FontWeight.w500,
69-
)
70-
..text(
71-
padding: EdgeInsets.only(left: 18.0, right: 18.0),
72-
text:
73-
"Let us help apps determine location. This means sending anonymous location data to us, even when no apps are running.",
74-
color: Colors.grey[500],
75-
fontSize: 15.0,
76-
)
77-
..doubleButton(
78-
padding: EdgeInsets.only(top: 24.0),
79-
mainAxisAlignment: MainAxisAlignment.end,
80-
text1: "DISAGREE",
81-
color1: Colors.deepPurpleAccent,
82-
fontSize1: 14.0,
83-
text2: "AGREE",
84-
color2: Colors.deepPurpleAccent,
85-
fontSize2: 14.0,
86-
)
87-
..show();
88-
}
895

906
var listTileItems = [
917
ListTileItem(
@@ -134,7 +50,7 @@ var listTileItems = [
13450
),
13551
];
13652

137-
YYDialog YYListTileDialog1(BuildContext context) {
53+
YYDialog YYListViewDialog1(BuildContext context) {
13854
return YYDialog().build(context)
13955
..width = 280
14056
..borderRadius = 4.0
@@ -149,7 +65,7 @@ YYDialog YYListTileDialog1(BuildContext context) {
14965
..show();
15066
}
15167

152-
YYDialog YYListViewDialog1(BuildContext context) {
68+
YYDialog YYListViewDialog2(BuildContext context) {
15369
return YYDialog().build(context)
15470
..width = 280
15571
..borderRadius = 4.0

β€Žlib/flutter_custom_dialog.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:flutter/material.dart';
22

3-
import 'components/dialog_item.dart';
3+
import 'package:flutter_custom_dialog/components/bean/dialog_item.dart';
44

55
class YYDialog {
66
List<Widget> widgetList = [];

0 commit comments

Comments
(0)

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /