justkawal / excel

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

Cannot delete sheets #346

Open horvathAdam285 opened 3 months ago

horvathAdam285 commented 3 months ago

Calling excel.delete(sheetName) can throw this error:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Unsupported operation: Cannot remove from an unmodifiable list E/flutter (20043): #0 UnmodifiableListMixin.removeWhere (dart:_internal/list.dart:139:5)

The problem seems to be trying to delete from _archive.files, which is an UnmodifiableListView

bahadirarslan commented 2 months ago

I am facing this issue while using the rename function. It tries to delete the old named sheet

Another-Chris commented 1 month ago

Apparently they are trying to call removeWhere() on _archive.files, which is an UnmodifiableListView
I am not sure why they make _archive.files unmodifiable but also call removeWhere on it. Dart documentation clearly says it is not supported. removeWhere method

luizgpa commented 6 days ago

Could anyone please confirm if that issue continues on 4.0.x?