Skip to content

Commit 11f4f6f

Browse files
committed
Merge branch 'develop'
2 parents f7e9672 + c7ffe16 commit 11f4f6f

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

cached_network_image/lib/src/image_provider/_image_loader.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class ImageLoader implements platform.ImageLoader {
125125
yield decoded;
126126
}
127127
}
128-
} on Object catch (e) {
128+
} on Object {
129129
// Depending on where the exception was thrown, the image cache may not
130130
// have had a chance to track the key in the cache at all.
131131
// Schedule a microtask to give the cache a chance to add the key.

cached_network_image_web/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [1.2.0] - 2024-04-29
2+
* Replace deprecated `webOnlyInstantiateImageCodecFromUrl` to `createImageCodecFromUrl` from `dart:ui_web`
3+
14
## [1.1.1] - 2023-12-31
25
* Removed errorListener from ImageLoader interface
36

cached_network_image_web/lib/cached_network_image_web.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ library cached_network_image_web;
44
import 'dart:async';
55
import 'dart:typed_data';
66
import 'dart:ui' as ui;
7+
import 'dart:ui_web';
78

89
import 'package:cached_network_image_platform_interface'
910
'/cached_network_image_platform_interface.dart' as platform
@@ -137,7 +138,7 @@ class ImageLoader implements platform.ImageLoader {
137138
yield decoded;
138139
}
139140
}
140-
} on Object catch (e) {
141+
} on Object {
141142
// Depending on where the exception was thrown, the image cache may not
142143
// have had a chance to track the key in the cache at all.
143144
// Schedule a microtask to give the cache a chance to add the key.
@@ -155,7 +156,7 @@ class ImageLoader implements platform.ImageLoader {
155156
) {
156157
final resolved = Uri.base.resolve(url);
157158
// ignore: undefined_function
158-
return ui.webOnlyInstantiateImageCodecFromUrl(
159+
return createImageCodecFromUrl(
159160
resolved,
160161
chunkCallback: (int bytes, int total) {
161162
chunkEvents.add(
@@ -165,7 +166,7 @@ class ImageLoader implements platform.ImageLoader {
165166
),
166167
);
167168
},
168-
) as Future<ui.Codec>;
169+
);
169170
}
170171
}
171172

cached_network_image_web/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: cached_network_image_web
22
description: Web implementation of CachedNetworkImage
3-
version: 1.1.1
3+
version: 1.2.0
44
homepage: https://github.com/Baseflow/flutter_cached_network_image
55

66
environment:

0 commit comments

Comments
 (0)