Floating constructor

Floating(
  1. Widget child, {
  2. FloatingSlideType slideType = FloatingSlideType.onRightAndBottom,
  3. double? top,
  4. double? left,
  5. double? right,
  6. double? bottom,
  7. double moveOpacity = 0.3,
  8. bool isPosCache = true,
  9. bool isShowLog = true,
  10. bool isSnapToEdge = true,
  11. double slideTopHeight = 0,
  12. double slideBottomHeight = 0,
})

child需要悬浮的 widget slideType,可参考FloatingSlideType

top,left,left,bottom 对应 slideType, 例如设置slideTypeFloatingSlideType.onRightAndBottom,则需要传入bottomright

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,
  );
}