DragDropItem constructor

DragDropItem({
  1. required String key,
  2. required String value,
  3. IconData? iconData,
  4. Widget? dragChild,
  5. Widget? dropChild,
  6. Widget? feedbackItem,
  7. Widget? childWhenDragging,
  8. bool isAccepted = false,
  9. TextStyle? defaultTextStyle,
})

Implementation

DragDropItem(
    {required this.key,
    required this.value,
    this.iconData,
    this.dragChild,
    this.dropChild,
    this.feedbackItem,
    this.childWhenDragging,
    this.isAccepted = false,
    this.defaultTextStyle}) {
  feedbackItem = dragChild ?? Icon(iconData, size: 30, color: Colors.teal);
  dragChild = dragChild ??
      Text(key, style: TextStyle(fontSize: 20, color: Colors.red));
  dropChild = dropChild ??
      Text(value,
          style: TextStyle(
            fontSize: 20,
          ));
  childWhenDragging = dragChild ??
      Text(value,
          style: TextStyle(
            fontSize: 20,
          ));
  this.defaultTextStyle = _defaultTextStyle;
}