OverlayService class
通用遮罩层服务
提供简单的 API 来显示和关闭从右侧滑入的遮罩层 可以在任何地方使用,无需重复编写遮罩层逻辑
Constructors
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
-
closeCurrentOverlay(
) → void - 触发当前打开的遮罩层关闭动画 如果有遮罩层打开,则触发其关闭动画 如果没有遮罩层打开,则不执行任何操作
-
showSlideInOverlay<
T> ({required BuildContext context, required Widget child, double widthRatio = 0.8, String barrierLabel = '关闭遮罩层', double backdropOpacity = 0.5, Duration animationDuration = const Duration(milliseconds: 300), bool barrierDismissible = true, BorderRadius? borderRadius, VoidCallback? onClose}) → Future< T?> - 显示从右侧滑入的遮罩层