SafeDialog class


  • 描述: 可以放心 dismiss 的 Dialog 工具类,
  • 可基于该类进行二次封装,类似 LoadingDialog 的 show、dismiss 方法
  • 注意:若想删除指定 Dialog,必须在 show、dismiss 方法时传 tag,

Constructors

SafeDialog()

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

dismiss<T extends Object?>({required BuildContext context, String tag = _safeDialogDefaultTag, T? result}) → void
用于关闭某个 Dialog,仅移除对应 tag 列表中最后入栈的 Dialog tag: 用于移除对应 tag 的 Dialog
show<T>({required BuildContext context, required WidgetBuilder builder, String tag = _safeDialogDefaultTag, bool barrierDismissible = true, Color? barrierColor = Colors.black54, String? barrierLabel, bool useSafeArea = true, bool useRootNavigator = true, RouteSettings? routeSettings}) Future<T?>
展示 Dialog tag : 用于标记 Dialog 类型