修改初始化 弹窗

This commit is contained in:
mmc
2026-03-13 08:50:45 +08:00
parent 00c5e736bd
commit 879701e07f
2 changed files with 70 additions and 34 deletions

View File

@@ -77,13 +77,13 @@ class ToastUtils {
}
/// 显示错误提示(红色背景 + 85%不透明度)
static void showError(BuildContext context, String message) {
static void showError(BuildContext context, String message, {int seconds = 1}) {
showToast(
context,
message,
// 红色:0xFFFF5252 → 调整为 0xD9FF5252(D9=85%不透明度)
backgroundColor: const Color(0xD9FF5252),
duration: const Duration(seconds: 1),
duration: Duration(seconds: seconds),
);
}