ToastManager class
可以管理 全局 toast 的默认配置信息
Properties
- duration ↔ int
-
默认的 toast 的展示时间
getter/setter pair
- findOverlayState ↔ OverlayState? Function()
-
用来自定义toast显示的 overlay 的寄存器
getter/setter pair
- gravity ↔ ToastGravity
-
默认的 toast 的展示位置
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- immediately ↔ bool
-
是否立即展示最新的toast 之前的toast将会立即结束或跳过展示
getter/setter pair
- messageWidgetBuilder ↔ ToastMessageWidgetBuilder
-
定义如何将 String 的 message 转换为widget
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- themeProvider ↔ ToastThemeProvider
-
用来提供toast的默认的主题信息
getter/setter pair
- toastAnimateBuilder ↔ Widget Function(BuildContext context, int duration, Widget toastWidget)
-
自定义全局的toast的出现动画
getter/setter pair
- useLifecycleTimer ↔ bool
-
使用与生命周期相关的计时器 当app不可见时会暂停计时器
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
showToast(
Widget builder(BuildContext context, int duration), {int? duration, ToastGravity? gravity, void onDismiss()?, Cancellable? cancellable, ToastThemeProvider? themeProvider}) → void - 也可以使用此函数 来展示一个完全自定义效果的toast 可自定义动画效果
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → ToastManager
-
no setter
Constants
- DURATION_LONG → const int
- DURATION_SHORT → const int