justkawal / excel

Excel Library for Flutter and Dart - https://pub.dev/packages/excel
MIT License
416 stars 229 forks source link

Exception: null does not work for DoubleCellValue when using insertRowIterables #317

Open Kontrano opened 8 months ago

Kontrano commented 8 months ago

I keep getting the error "Exception: null does not work for DoubleCellValue" when using the insertRowIterables Command the same thing happens when using a IntCellValue.

sheetObject.insertRowIterables([TextCellValue(name), DoubleCellValue(averageScore)], 5 + i); If i replace it with the following using updateCell it works fine

sheetObject.updateCell(CellIndex.indexByColumnRow(columnIndex: 0, rowIndex: 5+i), TextCellValue(name), cellStyle: normalStyle);
sheetObject.updateCell(CellIndex.indexByColumnRow(columnIndex: 1, rowIndex: 5+i), DoubleCellValue(averageScore), cellStyle: normalStyle);

Btw my normalSyle is only this:

var normalStyle = CellStyle(fontFamily: getFontFamily(FontFamily.Calibri));

Any idea why this is happening?

Im using: excel: ^4.0.2 archive: 3.4.9 flutter 3.16.5

ChristopherLinnett commented 8 months ago

look at #313 I had the same error for both DoubleCellValue and DateCellValue pop up when saving (also datetime) what was mentioned there was a workaround for the issue and I suspect has the same root cause.

Jayasubin commented 7 months ago

I faced this issue with IntCellValue and DoubleCellValue. But when I applied the CellStyle like @Kontrano posted here, it works as expected. Is the maintainer @justkawal fixing this issue?

natgross commented 4 months ago

Bump. Need a fix for this, please.