Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for: Cannot modify an unmodifiable list (@GeraldGZ's solution in #53) #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hunterwilhelm
Copy link

Copied from @GeraldGZ's solution

Solved:
docx_entry.dart function _updateData in line 25
old:

void _updateData(Archive arch, List<int> data) {
    if (_index < 0) {
      arch.addFile(ArchiveFile(_name, data.length, data));
    } else {
      arch.files[_index] = ArchiveFile(_name, data.length, data);
    }
}

change to:

void _updateData(Archive arch, List<int> data) {
      arch.addFile(ArchiveFile(_name, data.length, data));
}

because lib "archive" is used and there is a change in archive.dart with new version:

class Archive extends IterableBase<ArchiveFile> {
List<ArchiveFile> get files => UnmodifiableListView(_files);    //  <-- problem

but the addFile has new behavior:

// Adding a file with the same path as one that's already in the archive
// will replace the previous file.

@hunterwilhelm
Copy link
Author

#53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant