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
+
1
13
# [ 4.8.x]
2
14
- Breaking Change
3
15
- 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 {
68
68
void _showToast () async {
69
69
SmartDialog .showToast (
70
70
'test toast ---- ${Random ().nextInt (999 )}' ,
71
- displayType: SmartToastType .multi ,
71
+ displayType: SmartToastType .last ,
72
72
);
73
73
}
74
74
Original file line number Diff line number Diff line change @@ -155,10 +155,12 @@ class CustomToast extends BaseDialog {
155
155
curToast.onShowToast ();
156
156
if (toastQueue.length > 1 &&
157
157
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);
159
163
}
160
- await ToastTool .instance.delay (curToast.time);
161
- await ToastTool .instance.dismiss ();
162
164
ToastTool .instance.dispatchNext ();
163
165
}
164
166
Original file line number Diff line number Diff line change @@ -16,12 +16,16 @@ class ToastTool {
16
16
17
17
Queue <ToastInfo > toastQueue = ListQueue ();
18
18
19
- Future <void > dismiss ({bool closeAll = false }) async {
19
+ Future <void > dismiss ({bool closeAll = false , ToastInfo ? curToast }) async {
20
20
if (toastQueue.isEmpty) {
21
21
return ;
22
22
}
23
23
24
- var curToast = toastQueue.first;
24
+ if (curToast != null && ! toastQueue.contains (curToast)) {
25
+ return ;
26
+ }
27
+
28
+ curToast = curToast ?? toastQueue.first;
25
29
toastQueue.remove (curToast);
26
30
if (closeAll) {
27
31
toastQueue.clear ();
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ description:
3
3
An elegant Flutter Dialog solution,
4
4
Easily implement Toast, Loading and custom Dialog,
5
5
Make the use of the dialog easier!
6
- version : 4.8.2+5
6
+ version : 4.9.0
7
7
homepage : https://github.com/fluttercandies/flutter_smart_dialog
8
8
# flutter pub publish --server=https://pub.dartlang.org
9
9
You can’t perform that action at this time.
0 commit comments