TDToast class

改进的Toast组件,支持多个实例和独立样式

Constructors

TDToast()

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

dismissAll() → void
关闭所有Toast
dismissLoading() → void
关闭加载Toast(向后兼容)
dismissToast(String toastId) → void
关闭指定的Toast
showFail(String? text, {IconTextDirection direction = IconTextDirection.horizontal, required BuildContext context, Duration duration = const Duration(milliseconds: 3000), bool? preventTap, Color? backgroundColor, int? maxLines, TextStyle? textStyle, double? iconSize, Color? iconColor, String? toastId}) String
失败提示Toast
showIconText(String? text, {IconData? icon, IconTextDirection direction = IconTextDirection.horizontal, required BuildContext context, Duration duration = const Duration(milliseconds: 3000), bool? preventTap, Color? backgroundColor, int? maxLines, TextStyle? textStyle, double? iconSize, Color? iconColor, String? toastId}) String
带图标的Toast
showLoading({required BuildContext context, String? text, Duration duration = const Duration(seconds: 99999999), bool? preventTap, Widget? customWidget, Color? backgroundColor, TextStyle? textStyle, double? iconSize, Color? iconColor, String? toastId}) String
带文案的加载Toast
showLoadingWithoutText({required BuildContext context, Duration duration = const Duration(seconds: 99999999), bool? preventTap, Color? backgroundColor, double? iconSize, Color? iconColor, String? toastId}) String
不带文案的加载Toast
showSuccess(String? text, {IconTextDirection direction = IconTextDirection.horizontal, required BuildContext context, Duration duration = const Duration(milliseconds: 3000), bool? preventTap, Color? backgroundColor, int? maxLines, TextStyle? textStyle, double? iconSize, Color? iconColor, String? toastId}) String
成功提示Toast
showText(String? text, {required BuildContext context, Duration duration = const Duration(milliseconds: 3000), int? maxLines, BoxConstraints? constraints, bool? preventTap, Widget? customWidget, Color? backgroundColor, TextStyle? textStyle, String? toastId}) String
普通文本Toast
showWarning(String? text, {IconTextDirection direction = IconTextDirection.horizontal, required BuildContext context, Duration duration = const Duration(milliseconds: 3000), bool? preventTap, Color? backgroundColor, int? maxLines, TextStyle? textStyle, double? iconSize, Color? iconColor, String? toastId}) String
警告Toast