@@ -63,41 +63,21 @@ class SmartDialogPage extends StatelessWidget {
6363 }
6464
6565 void _show () async {
66- //关闭多个相同tag dialog
67- tagDialog (String tag) {
68- SmartDialog .show (
69- tag: tag,
70- builder: (_) {
71- return Container (
72- height: 80 ,
73- width: 180 ,
74- decoration: BoxDecoration (
75- color: Colors .black,
76- borderRadius: BorderRadius .circular (10 ),
77- ),
78- alignment: Alignment .center,
79- child: Text (
80- 'easy custom dialog' ,
81- style: TextStyle (color: Colors .white),
82- ),
83- );
84- },
66+ SmartDialog .show (builder: (_) {
67+ return Container (
68+ height: 80 ,
69+ width: 180 ,
70+ decoration: BoxDecoration (
71+ color: Colors .black,
72+ borderRadius: BorderRadius .circular (10 ),
73+ ),
74+ alignment: Alignment .center,
75+ child: Text (
76+ 'easy custom dialog' ,
77+ style: TextStyle (color: Colors .white),
78+ ),
8579 );
86- }
87- var tag = "1" ;
88- for (var i = 0 ; i < 3 ; i++ ) {
89- tagDialog (tag);
90- await Future .delayed (Duration (milliseconds: 300 ));
91- }
92- SmartDialog .dismiss (tag: tag, status: SmartStatus .allDialog);
93-
94- //穿透遮罩
95- SmartDialog .show (
96- usePenetrate: true ,
97- builder: (_) {
98- return Container (height: 80 , width: 180 , color: Colors .black);
99- },
100- );
80+ });
10181 }
10282
10383 void _showAttach (BuildContext ctx) {
@@ -139,7 +119,8 @@ class SmartDialogPage extends StatelessWidget {
139119 void _bindPage (BuildContext ctx) {
140120 //target widget
141121 SmartDialog .show (
142- bindPage: true ,
122+ // bindPage: true,
123+ // bindWidget: ctx,
143124 builder: (_) {
144125 return Container (
145126 height: 300 ,
@@ -151,14 +132,22 @@ class SmartDialogPage extends StatelessWidget {
151132 alignment: Alignment .center,
152133 child: ElevatedButton (
153134 onPressed: () {
154- Navigator .push (ctx, MaterialPageRoute (builder: (_) {
155- return Scaffold (
156- appBar: AppBar (
157- title: Text ("New Page" ),
158- ),
159- body: Center (child: Text ("New Page" )),
160- );
161- }));
135+ SmartDialog .show (
136+ alignment: Alignment .bottomCenter,
137+ useSystem: true ,
138+ builder: (_) {
139+ return Container (
140+ height: 30 , width: 30 , color: Colors .black);
141+ });
142+
143+ // Navigator.push(ctx, MaterialPageRoute(builder: (_) {
144+ // return Scaffold(
145+ // appBar: AppBar(
146+ // title: Text("New Page"),
147+ // ),
148+ // body: Center(child: Text("New Page")),
149+ // );
150+ // }));
162151 },
163152 child: Text ('to new page' ),
164153 ),
0 commit comments