FloatingOverlayController.absoluteSize constructor

FloatingOverlayController.absoluteSize({
  1. Size? minSize,
  2. Size? maxSize,
  3. EdgeInsets? padding,
  4. Offset? start,
  5. bool constrained = false,
  6. double? cursorArea,
})

The controller for the FloatingOverlay.

Be sure to initialize this only once (probably inside initState method) when inside a Stateful Widget that has an AnimationController inside.

Implementation

FloatingOverlayController.absoluteSize({
  /// Minimum size to resize the floating child.
  Size? minSize,

  /// Maximum size to resize the floating child.
  Size? maxSize,

  /// Padding inside the constraints of the floating child's space to float.
  EdgeInsets? padding,

  /// Offset inside the constraints of the floating child's space to float.
  Offset? start,

  /// If the floating child's space to float will be limited by the maximum
  /// size that the FloatingOverlay can be.
  bool constrained = false,

  /// Cursor detection pixel area.
  double? cursorArea,
})  : _cursorArea = cursorArea,
      _offset = _FloatingOverlayOffset(
        start: start,
        padding: padding,
        constrained: constrained,
      ),
      _scale = _FloatingOverlayScale.absolute(
        maxSize: maxSize,
        minSize: minSize,
      ),
      super(
        FloatingOverlayData(
          childSize: Size.zero,
          scale: 1.0,
          position: _FloatingOverlayOffset(
            start: start,
            padding: padding,
          ).state,
        ),
      ) {
  _cursorController = _FloatingOverlayCursor(scale: _scale, offset: _offset);
  _streamProcess();
}