copyToClipboardListener method
Implementation
void copyToClipboardListener(ClipboardEvent event) {
if (_copyFull) {
final cpData = StringBuffer()
..writeln(
headersRow.cells.map((cell) => cell.text).toList().join('\t'));
for (final row in rows) {
for (var i = 0; i < columns.length; i++) {
final value = row.data[i];
final column = columns[i];
var formattedValue = '';
if (value is SimpleTableHref) {
formattedValue = value.caption;
} else if (value is SimpleTableImage) {
formattedValue = value.url;
} else if (value is List) {
formattedValue = value.join(';');
} else if (value == null) {
formattedValue = '';
} else if (value is num) {
formattedValue =
value.toStringAsFixed(column.precision).replaceAll('.', ',');
} else {
formattedValue = value.toString();
}
cpData.write('$formattedValue\t');
}
cpData.write('\n');
}
event.clipboardData!.setData('text/plain', cpData.toString());
event.preventDefault();
}
}