ToastUtil class

Toast工具类 - 提供美观友好的提示UI

Constructors

ToastUtil()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

showError(BuildContext context, String message, {Duration duration = const Duration(seconds: 3), VoidCallback? onRetry}) → void
显示错误提示
showInfo(BuildContext context, String message, {Duration duration = const Duration(seconds: 2)}) → void
显示信息提示
showLoading(BuildContext context, String message, {Duration duration = const Duration(seconds: 3)}) → void
显示加载提示
showNetworkError(BuildContext context, int statusCode, String userMessage, {VoidCallback? onRetry}) → void
显示网络错误(专门处理NetworkException)
showSuccess(BuildContext context, String message, {Duration duration = const Duration(seconds: 2)}) → void
显示成功提示
showWarning(BuildContext context, String message, {Duration duration = const Duration(seconds: 2)}) → void
显示警告提示