I put the template Excel file in the asset folder and tested it.
var _excel = SpreadsheetDecoder.decodeBytes(bytes, update: true);
String sheet = _excel.tables.keys.first;
print('Sheet:>>>>${sheet}');
_excel
..updateCell(sheet, 0, 1, "aaaaaaaaaa")
..updateCell(sheet, 1, 1, 'bbbbbbbbbb')
..updateCell(sheet, 2, 1, 'cccccccccc')
..updateCell(sheet, 1, 2, 8880.3)
..insertRow(sheet, 1)
..insertRow(sheet, 20)
..updateCell(sheet, 0, 09, 'A14=========}')
..updateCell(sheet, 0, 15, 'A13---------}')
..insertColumn(sheet, 0);
var b = _excel.encode();
Error: RangeError: Invalid value: Not in inclusive range 0..12: 20
at Object.throw_ [as throw] (http://localhost:56557/dart_sdk.js:5063:11)
at spreadsheet_decoder.XlsxDecoder.new.insertRow (http://localhost:56557/packages/spreadsheet_decoder/spreadsheet_decoder.dart.lib.js:227:19)
at spreadsheet_decoder.XlsxDecoder.new.insertRow (http://localhost:56557/packages/spreadsheet_decoder/spreadsheet_decoder.dart.lib.js:855:13)
at http://localhost:56557/packages/pronto/pages/base_product_page/excel_upload/product_excel_repository.dart.lib.js:198:12
at testexcel (http://localhost:56557/packages/pronto/pages/base_product_page/excel_upload/product_excel_repository.dart.lib.js:203:9)
at testexcel.next (<anonymous>)
at http://localhost:56557/dart_sdk.js:40192:33
at _RootZone.runUnary (http://localhost:56557/dart_sdk.js:40062:59)
at _FutureListener.thenAwait.handleValue (http://localhost:56557/dart_sdk.js:34983:29)
at handleValueCallback (http://localhost:56557/dart_sdk.js:35551:49)
at Function._propagateToListeners (http://localhost:56557/dart_sdk.js:35589:17)
at _Future.new.[_completeWithValue] (http://localhost:56557/dart_sdk.js:35437:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:56557/dart_sdk.js:35458:35)
at Object._microtaskLoop (http://localhost:56557/dart_sdk.js:40330:13)
at _startMicrotaskLoop (http://localhost:56557/dart_sdk.js:40336:13)
at http://localhost:56557/dart_sdk.js:35811:9
ProductCount:168
I put the template Excel file in the asset folder and tested it.
sample codel:
Error: