setDisplayText method

void setDisplayText(
  1. String value,
  2. bool isDefaultMessage
)

set the text to be displayed close to the cursor during a drag and drop operation

Implementation

void setDisplayText(String value, bool isDefaultMessage) {
  if (isDefaultMessage && !_showDefaultMessages) {
    _displayText = "";
  } else {
    _displayText = value;
  }

  if (_messageToShowDuringDrag != null &&
      _messageToShowDuringDrag!.trim() != "") {
    if (_displayText != "") {
      _displayText += '\n';
    }
    _displayText += _messageToShowDuringDrag!;
  }

  if (_messageToShowDuringMove != null &&
      _messageToShowDuringMove!.trim() != "") {
    if (_displayText != "") {
      _displayText += '\n';
    }
    _displayText += _messageToShowDuringMove!;
  }

  notifyListeners();
}