File tree Expand file tree Collapse file tree 5 files changed +25
-7
lines changed Expand file tree Collapse file tree 5 files changed +25
-7
lines changed Original file line number Diff line number Diff line change 1+ # [ 4.9.0]
2+ - Breaking Change
3+ - refactor Toast: remove 'SmartToastType.first' and 'SmartToastType.firstAndLast'
4+ - Feature
5+ - add 'SmartToastType.multi': Can display multi toasts at the same time
6+ - add showNotify: By setting NotifyType, many different types of Notify dialog can be used
7+ - showNotify custom style: You can set the default dialog style for showNotify through the notifyStyle parameter in FlutterSmartDialog.init ()
8+ - solve [ #102 ] ( https://github.com/fluttercandies/flutter_smart_dialog/issues/102 )
9+ - fix [ #110 ] ( https://github.com/fluttercandies/flutter_smart_dialog/issues/110 )
10+ - solve [ #111 ] ( https://github.com/fluttercandies/flutter_smart_dialog/issues/111 )
11+
12+
113# [ 4.8.x]
214- Breaking Change
315 - If the 'bindPage' of the dialog is false, the dialog will not be closed when the page is closed
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ class SmartDialogPage extends StatelessWidget {
6868 void _showToast () async {
6969 SmartDialog .showToast (
7070 'test toast ---- ${Random ().nextInt (999 )}' ,
71- displayType: SmartToastType .multi ,
71+ displayType: SmartToastType .last ,
7272 );
7373 }
7474
Original file line number Diff line number Diff line change @@ -155,10 +155,12 @@ class CustomToast extends BaseDialog {
155155 curToast.onShowToast ();
156156 if (toastQueue.length > 1 &&
157157 toastQueue.elementAt (1 ).type == SmartToastType .last) {
158- curToast.time = Duration (milliseconds: 50 );
158+ toastQueue.remove (curToast);
159+ curToast.mainDialog.overlayEntry.remove ();
160+ } else {
161+ await ToastTool .instance.delay (curToast.time);
162+ await ToastTool .instance.dismiss (curToast: curToast);
159163 }
160- await ToastTool .instance.delay (curToast.time);
161- await ToastTool .instance.dismiss ();
162164 ToastTool .instance.dispatchNext ();
163165 }
164166
Original file line number Diff line number Diff line change @@ -16,12 +16,16 @@ class ToastTool {
1616
1717 Queue <ToastInfo > toastQueue = ListQueue ();
1818
19- Future <void > dismiss ({bool closeAll = false }) async {
19+ Future <void > dismiss ({bool closeAll = false , ToastInfo ? curToast }) async {
2020 if (toastQueue.isEmpty) {
2121 return ;
2222 }
2323
24- var curToast = toastQueue.first;
24+ if (curToast != null && ! toastQueue.contains (curToast)) {
25+ return ;
26+ }
27+
28+ curToast = curToast ?? toastQueue.first;
2529 toastQueue.remove (curToast);
2630 if (closeAll) {
2731 toastQueue.clear ();
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ description:
33 An elegant Flutter Dialog solution,
44 Easily implement Toast, Loading and custom Dialog,
55 Make the use of the dialog easier!
6- version : 4.8.2+5
6+ version : 4.9.0
77homepage : https://github.com/fluttercandies/flutter_smart_dialog
88# flutter pub publish --server=https://pub.dartlang.org
99
You can’t perform that action at this time.
0 commit comments