Floating constructor
Floating(})
child
需要悬浮的 widget
slideType
,可参考FloatingSlideType
top
,left
,left
,bottom
对应 slideType
,
例如设置slideType
为FloatingSlideType.onRightAndBottom,则需要传入bottom
和right
isPosCache
启用之后当调用之后 Floating.close 重新调用 Floating.open 后会保持之前的位置
isSnapToEdge
是否自动吸附边缘,默认为 true ,请注意,移动默认是有透明动画的,如需要关闭透明度动画,
请修改 moveOpacity
为 1
slideTopHeight
滑动边界控制,可滑动到顶部的距离
slideBottomHeight
滑动边界控制,可滑动到底部的距离
Implementation
Floating(
Widget child, {
FloatingSlideType slideType = FloatingSlideType.onRightAndBottom,
double? top,
double? left,
double? right,
double? bottom,
double moveOpacity = 0.3,
bool isPosCache = true,
bool isShowLog = true,
bool isSnapToEdge = true,
this.slideTopHeight = 0,
this.slideBottomHeight = 0,
}) {
_floatingData = FloatingData(slideType,
left: left, right: right, top: top, bottom: bottom);
_log = FloatingLog(isShowLog);
_hideController = HideController();
_floatingView = FloatingView(
child,
_floatingData,
isPosCache,
isSnapToEdge,
_hideController,
_listener,
_log,
moveOpacity: moveOpacity,
slideTopHeight: slideTopHeight,
slideBottomHeight: slideBottomHeight,
);
}