WbToast class

通用的Toast组件

Constructors

WbToast()

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 Properties

preToastView ↔ _ToastView?
_ToastView
getter/setter pair

Static Methods

getVerticalOffset({required BuildContext context, WbToastGravity? gravity, double? verticalOffset}) double
获取默认设置的垂直间距
show(String text, BuildContext context, {Duration? duration, Color? background, TextStyle textStyle = const TextStyle(fontSize: 16, color: Colors.white), double? radius, Image? preIcon, double? verticalOffset, VoidCallback? onDismiss, WbToastGravity? gravity}) → void
显示Toast,如不设置duration则会自动根据内容长度来计算(更友好,最长5秒)
showInCenter({required String text, required BuildContext context, Duration? duration}) → void
显示在中间。如不设置duration则会自动根据内容长度来计算(更友好,最长5秒)