@@ -9,18 +9,17 @@ class YYDialog {
9
9
BoxDecoration decoration;
10
10
BoxConstraints constraints;
11
11
12
- YYDialog ({ this . context} ) {
13
- // this.width = MediaQuery.of( context).size.width * .8 ;
14
- // this.height = MediaQuery.of(context).size.height * .3 ;
12
+ YYDialog build ( context) {
13
+ this .context = context;
14
+ return this ;
15
15
}
16
16
17
- YYDialog build ( ) {
18
- print ( 'build' );
17
+ YYDialog widget ( Widget child ) {
18
+ this .widgetList. add (child );
19
19
return this ;
20
20
}
21
21
22
- next () {
23
- print ('next' );
22
+ void show () {
24
23
Size size = MediaQuery .of (context).size;
25
24
CustomDialog (
26
25
context: context,
@@ -30,16 +29,17 @@ class YYDialog {
30
29
Material (
31
30
type: MaterialType .transparency,
32
31
child: Container (
33
- decoration: decoration ?? BoxDecoration (
34
- color: Colors .white,
35
- ),
36
- // 限制container大小
37
- constraints: constraints ?? BoxConstraints (
38
- // minHeight: size.height * .3,
39
- // minWidth: size.width * .8,
40
- // maxHeight: size.height * .5,
41
- maxWidth: size.width * .8 ,
42
- ),
32
+ width: width,
33
+ height: height,
34
+ decoration: decoration ??
35
+ BoxDecoration (
36
+ color: Colors .white,
37
+ ),
38
+ constraints: constraints ??
39
+ BoxConstraints (
40
+ minHeight: size.height * .01 ,
41
+ minWidth: size.width * .01 ,
42
+ ),
43
43
child: Column (
44
44
children: widgetList,
45
45
),
@@ -49,16 +49,6 @@ class YYDialog {
49
49
),
50
50
);
51
51
}
52
-
53
- show () {
54
- print ('show' );
55
- this .next ();
56
- }
57
-
58
- YYDialog widget (Widget child) {
59
- this .widgetList.add (child);
60
- return this ;
61
- }
62
52
}
63
53
64
54
class CustomDialog {
0 commit comments