DraggableWidget constructor

DraggableWidget({
  1. Key? key,
  2. required Widget widget,
  3. required InitialPosition initialPosition,
  4. required double height,
  5. required double width,
  6. double dragSpeed = 2.0,
  7. double? left,
  8. double? top,
})

DraggableWidget constructor. Parameters:

  • widget: the widget to be draggable.
  • height: the height of the draggable widget.
  • width: the width of the draggable widget.
  • dragSpeed: the speed of dragging.
  • initialPosition: the initial position of the draggable widget.
  • left: optional left position for custom initial position.
  • top: optional top position for custom initial position.

Implementation

DraggableWidget({
  Key? key,
  required this.widget,
  required this.initialPosition,
  required this.height,
  required this.width,
  this.dragSpeed = 2.0,
  this.left,
  this.top,
}) : super(key: key) {
  _validateInput();
}