FloatingOverlay constructor

FloatingOverlay(
  1. Widget child, {
  2. FloatingEdgeType slideType = FloatingEdgeType.onRightAndBottom,
  3. double? top,
  4. double? left,
  5. double? right,
  6. double? bottom,
  7. String? logKey,
  8. FPosition<double>? position,
  9. FloatingParams? params,
  10. FloatingCommonController? controller,
})

child需要悬浮的 widget

top,left,left,bottom,position 对应 slideType,设置与起始点的距离 例如设置slideTypeFloatingEdgeType.onRightAndBottom,则需要传入bottomright logKey设置 FloatingLog 标识 positionslideTypeFloatingEdgeType.onPoint 传入 params 配置参数集合,按需传入 controller 通用控制器,提供显示/隐藏,设置偏移,吸附等等。 内部默认会创建,通过FloatingOverlay.controller获取即可。也可自行创建传入即可。

Implementation

FloatingOverlay(
  Widget child, {
  FloatingEdgeType slideType = FloatingEdgeType.onRightAndBottom,
  double? top,
  double? left,
  double? right,
  double? bottom,
  String? logKey,
  FPosition<double>? position,
  FloatingParams? params,
  FloatingCommonController? controller,
}) {
  _floatingData = FloatingData(slideType,
      left: left, right: right, top: top, bottom: bottom, position: position);
  var param = params ?? const FloatingParams();
  _log = FloatingLog(param.isShowLog, logKey ?? '');
  // 记录 controller 所有权:若外部未传入 controller,则由本实例创建并负责释放
  _commonControl = controller ?? FloatingCommonController();
  _listenerController = FloatingListenerController();
  _floatingView = FloatingView(
    child,
    _floatingData,
    param,
    _listenerController,
    _commonControl,
    _log,
  );
}