diff --git a/lib/src/excel.dart b/lib/src/excel.dart index f57588d7..41d77263 100644 --- a/lib/src/excel.dart +++ b/lib/src/excel.dart @@ -79,7 +79,7 @@ class Excel { } factory Excel.decodeBuffer(InputStream input) { - return _newExcel(ZipDecoder().decodeBuffer(input)); + return _newExcel(ZipDecoder().decodeStream(input)); } /// diff --git a/lib/src/utilities/archive.dart b/lib/src/utilities/archive.dart index 56a9238e..03f2aae2 100644 --- a/lib/src/utilities/archive.dart +++ b/lib/src/utilities/archive.dart @@ -16,10 +16,12 @@ Archive _cloneArchive( if (_archiveFiles.containsKey(file.name)) { copy = _archiveFiles[file.name]!; } else { - var content = file.content as Uint8List; - var compress = !_noCompression.contains(file.name); + var content = file.content; + var compression = _noCompression.contains(file.name) + ? CompressionType.none + : CompressionType.deflate; copy = ArchiveFile(file.name, content.length, content) - ..compress = compress; + ..compression = compression; } clone.addFile(copy); } diff --git a/pubspec.yaml b/pubspec.yaml index d23fdb06..7249cece 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: excel description: A flutter and dart library for reading, creating, editing and updating excel sheets with compatible both on client and server side. -version: 4.0.6 +version: 4.0.7 homepage: https://github.com/justkawal/excel topics: - excel @@ -13,7 +13,7 @@ environment: sdk: ">=3.0.0 <4.0.0" dependencies: - archive: ^3.6.1 + archive: ^4.0.2 xml: ">=5.0.0 <7.0.0" collection: ^1.15.0 equatable: ^2.0.0