diff --git a/lib/core/csv/result_grid_csv.dart b/lib/core/csv/result_grid_csv.dart index f58e157f..7b4a2f33 100644 --- a/lib/core/csv/result_grid_csv.dart +++ b/lib/core/csv/result_grid_csv.dart @@ -2,7 +2,6 @@ library; import 'dart:io'; -import 'dart:isolate'; String escapeCsvField(String s) { final needsQuotes = s.contains(',') || @@ -27,8 +26,9 @@ String formatCsvDataRow(List row, int columnCount) { /// One line per row; pads short rows with empty cells to [columns.length]. /// -/// Prefer [resultGridAsCsvAsync] for large grids on the UI isolate, and -/// [writeResultGridCsv] when writing to a file. +/// For large grids use [writeResultGridCsv] when writing to a file; +/// `DataExportService.formatAsync` runs this off the UI isolate for the +/// clipboard. String resultGridAsCsv(List columns, List> rows) { final buf = StringBuffer(); buf.write(columns.map(escapeCsvField).join(',')); @@ -39,14 +39,6 @@ String resultGridAsCsv(List columns, List> rows) { return buf.toString(); } -/// Builds CSV off the UI isolate so large grids do not freeze the main thread. -Future resultGridAsCsvAsync( - List columns, - List> rows, -) { - return Isolate.run(() => resultGridAsCsv(columns, rows)); -} - /// Streams CSV to [sink] without assembling the full document in memory. Future writeResultGridCsv( IOSink sink, { diff --git a/test/core/csv/result_grid_csv_test.dart b/test/core/csv/result_grid_csv_test.dart index 6c5d75c2..b29fea9d 100644 --- a/test/core/csv/result_grid_csv_test.dart +++ b/test/core/csv/result_grid_csv_test.dart @@ -32,18 +32,6 @@ void main() { }); }); - group('resultGridAsCsvAsync', () { - test('matches synchronous result off the UI isolate', () async { - const columns = ['a', 'b']; - const rows = [ - ['1', 'two,comma'], - ['quote', 'say "hi"'], - ]; - final asyncCsv = await resultGridAsCsvAsync(columns, rows); - expect(asyncCsv, resultGridAsCsv(columns, rows)); - }); - }); - group('writeResultGridCsv', () { test('streams the same content as resultGridAsCsv', () async { const columns = ['a', 'b'];