Skip to content

Commit

Permalink
Upgrade package:archive ^4.0.0 (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
xvrh authored Dec 16, 2024
1 parent 84cfa16 commit f892a14
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 10 deletions.
12 changes: 10 additions & 2 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ packages:
dependency: transitive
description:
name: archive
sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d
sha256: "08064924cbf0ab88280a0c3f60db9dd24fec693927e725ecb176f16c629d1cb8"
url: "https://pub.dev"
source: hosted
version: "3.6.1"
version: "4.0.1"
async:
dependency: transitive
description:
Expand Down Expand Up @@ -274,6 +274,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.8"
posix:
dependency: transitive
description:
name: posix
sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a
url: "https://pub.dev"
source: hosted
version: "6.0.1"
shelf:
dependency: "direct dev"
description:
Expand Down
10 changes: 5 additions & 5 deletions lib/src/composition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class LottieComposition {
}
jsonFile ??= archive.files.firstWhere((e) => e.name.endsWith('.json'));

var composition = parseJsonBytes(jsonFile.content as Uint8List);
var composition = parseJsonBytes(jsonFile.content);

for (var image in composition.images.values) {
var imagePath = p.posix.join(image.dirName, image.fileName);
Expand All @@ -94,17 +94,17 @@ class LottieComposition {
}

if (found != null) {
image.loadedImage ??= await loadImage(
composition, image, MemoryImage(found.content as Uint8List));
image.loadedImage ??=
await loadImage(composition, image, MemoryImage(found.content));
}
}

for (var font in archive.files.where((f) => f.name.endsWith('.ttf'))) {
var fileName = p.basenameWithoutExtension(font.name).toLowerCase();
var existingFont = composition.fonts.values
.firstWhereOrNull((f) => f.family.toLowerCase() == fileName);
composition._fontsToLoad.add(FontToLoad(font.content as Uint8List,
family: existingFont?.family));
composition._fontsToLoad
.add(FontToLoad(font.content, family: existingFont?.family));
}
return composition;
}
Expand Down
20 changes: 18 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ packages:
dependency: "direct main"
description:
name: archive
sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d
sha256: "08064924cbf0ab88280a0c3f60db9dd24fec693927e725ecb176f16c629d1cb8"
url: "https://pub.dev"
source: hosted
version: "3.6.1"
version: "4.0.1"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -110,6 +110,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.1"
ffi:
dependency: transitive
description:
name: ffi
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -240,6 +248,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.9.0"
posix:
dependency: transitive
description:
name: posix
sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a
url: "https://pub.dev"
source: hosted
version: "6.0.1"
pub_semver:
dependency: "direct dev"
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ environment:
flutter: '>=3.27.0'

dependencies:
archive: ^3.3.8
archive: ^4.0.0
flutter:
sdk: flutter
http: ^1.0.0
Expand Down

0 comments on commit f892a14

Please sign in to comment.