copyRowsToClipboard method

Future<int> copyRowsToClipboard(
  1. Iterable<int> rowIndices, {
  2. bool includeHeader = false,
})

Copy whole rows to the system clipboard as TSV. Returns rows written.

Implementation

Future<int> copyRowsToClipboard(Iterable<int> rowIndices, {bool includeHeader = false}) async {
  final tsv = rowsAsTsv(rowIndices, includeHeader: includeHeader);
  if (tsv.isEmpty) return 0;
  await Clipboard.setData(ClipboardData(text: tsv));
  return '\n'.allMatches(tsv).length + 1;
}