Skip to content

Commit ea1732b

Browse files
committed
feat: make this library dart 3 compatible
1 parent df861b1 commit ea1732b

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

lib/csv_to_list_converter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ CsvParser? _buildNewParserWithSettings(
178178
}
179179

180180
/// The input sink for a chunked csv-string to list conversion.
181-
class CsvToListSink extends ChunkedConversionSink<String> {
181+
class CsvToListSink implements ChunkedConversionSink<String> {
182182
/// Rows converted to Lists are added to this sink.
183183
final Sink<List> _outSink;
184184

lib/list_to_csv_converter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class ListToCsvConverter extends StreamTransformerBase<List, String>
278278
///
279279
/// A single row represented by a [List] may be [add]ed an
280280
/// the conversion is added to the output sink.
281-
class List2CsvSink extends ChunkedConversionSink<List<List>> {
281+
class List2CsvSink implements ChunkedConversionSink<List<List>> {
282282
/// The List2CsvConverter which has the configurations (fieldDelimiter,
283283
/// textDel., eol)
284284
final ListToCsvConverter _converter;

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ homepage: https://github.com/close2/csv
88
documentation: https://github.com/close2/csv
99

1010
environment:
11-
sdk: '>=2.12.0 <3.0.0'
11+
sdk: '>=2.12.0 <4.0.0'
1212

1313
dev_dependencies:
1414
test: ^1.16.8

test/csv_to_list_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,8 @@ void main_converter() {
516516
csvSingleRowComma,
517517
shouldParseNumbers: true,
518518
);
519-
}, throwsA(isA<TypeError>()));
519+
}, anyOf([throwsA(isA<TypeError>()), throwsA(isA<AssertionError>())]));
520+
// dart 2 throws an `AssertionError`, dart 3 a `TypeError`
520521
});
521522
test('to return dynamic csv', () {
522523
expect(

0 commit comments

Comments
 (0)