Skip to content

Commit 714c5bf

Browse files
committed
adjust CustomToast
1 parent 938fbfb commit 714c5bf

File tree

1 file changed

+28
-26
lines changed

1 file changed

+28
-26
lines changed

lib/src/custom/toast/custom_toast.dart

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -75,32 +75,34 @@ class CustomToast extends BaseDialog {
7575
);
7676
}
7777

78-
if (displayType == SmartToastType.normal) {
79-
await normalToast(
80-
time: displayTime,
81-
onShowToast: showToast,
82-
mainDialog: mainDialog,
83-
);
84-
} else if (displayType == SmartToastType.last) {
85-
await lastToast(
86-
time: displayTime,
87-
onShowToast: showToast,
88-
mainDialog: mainDialog,
89-
);
90-
} else if (displayType == SmartToastType.onlyRefresh) {
91-
await onlyRefresh(
92-
time: displayTime,
93-
widget: widget,
94-
onShowToast: showToast,
95-
mainDialog: mainDialog,
96-
);
97-
} else if (displayType == SmartToastType.multi) {
98-
await multiToast(
99-
time: displayTime,
100-
onShowToast: showToast,
101-
mainDialog: mainDialog,
102-
);
103-
}
78+
try {
79+
if (displayType == SmartToastType.normal) {
80+
await normalToast(
81+
time: displayTime,
82+
onShowToast: showToast,
83+
mainDialog: mainDialog,
84+
);
85+
} else if (displayType == SmartToastType.last) {
86+
await lastToast(
87+
time: displayTime,
88+
onShowToast: showToast,
89+
mainDialog: mainDialog,
90+
);
91+
} else if (displayType == SmartToastType.onlyRefresh) {
92+
await onlyRefresh(
93+
time: displayTime,
94+
widget: widget,
95+
onShowToast: showToast,
96+
mainDialog: mainDialog,
97+
);
98+
} else if (displayType == SmartToastType.multi) {
99+
await multiToast(
100+
time: displayTime,
101+
onShowToast: showToast,
102+
mainDialog: mainDialog,
103+
);
104+
}
105+
} catch (_) {}
104106
}
105107

106108
///--------------------------multi type toast--------------------------

0 commit comments

Comments
 (0)