close2 / csv

A dart csv to list codec / converter
MIT License
98 stars 24 forks source link

Different output in debug and when deployed #52

Closed andibardhi closed 2 years ago

andibardhi commented 2 years ago

Screenshot_2 Screenshot_4 So I was testing CSV documents in flutter and when debugging I get a List of Lists (a list for each row) as you can see in the attachment, but when deploying I get a different result: A List of a List with every cell value (also attached). My code: Future<void> loadCSV() async { final _rawData = await rootBundle.loadString("assets/test.csv"); List<List<dynamic>> listData = const CsvToListConverter().convert(_rawData); js.context.callMethod("alert", <String>["listData $listData"]); } Build command: if cd flutter; then git pull && cd ..; else git clone https://github.com/flutter/flutter.git; fi && flutter/bin/flutter config --enable-web && flutter/bin/flutter build web --release

close2 commented 2 years ago

This is probably an end-of-line problem.

It is likely that your local system uses a different eol character than the system where the app is deployed.

You can either specify the EOL using the eol parameter, or use the FirstOccurrenceSettingsDetector (see README)

Please reopen if you eols are not the problem.