This commit is contained in:
sion
2026-04-07 01:05:05 +08:00
parent edad10ff06
commit 5ca1274607
83 changed files with 1561 additions and 1241 deletions

View File

@@ -1,13 +1,13 @@
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
/// Toast 工具 - 提供一的 toast 提示功能
/// Toast 工具 - 提供一的 toast 提示功能
///
/// 使用 bot_toast 实现,确保 toast 示在所有窗之上
/// 使用 bot_toast 實現,確保 toast 示在所有窗之上
class ToastUtils {
ToastUtils._();
/// 示普通提示
/// 示普通提示
static void show(String message, {Duration? duration}) {
BotToast.showCustomText(
toastBuilder: (_) => _buildToastWidget(message),
@@ -18,7 +18,7 @@ class ToastUtils {
);
}
/// 示成功提示
/// 示成功提示
static void showSuccess(String message, {Duration? duration}) {
BotToast.showCustomText(
toastBuilder: (_) => _buildToastWidget(
@@ -32,7 +32,7 @@ class ToastUtils {
);
}
/// 显示错误提示
/// 顯示錯誤提示
static void showError(String message, {Duration? duration}) {
BotToast.showCustomText(
toastBuilder: (_) => _buildToastWidget(
@@ -46,7 +46,7 @@ class ToastUtils {
);
}
/// 示警告提示
/// 示警告提示
static void showWarning(String message, {Duration? duration}) {
BotToast.showCustomText(
toastBuilder: (_) => _buildToastWidget(
@@ -60,7 +60,7 @@ class ToastUtils {
);
}
/// 建 toast widget
/// 建 toast widget
static Widget _buildToastWidget(
String message, {
Color? backgroundColor,