From d201bd41677fb99f35a441b662f2fdda0961031b Mon Sep 17 00:00:00 2001 From: Mohib Date: Sun, 31 Dec 2023 12:26:10 +0000 Subject: [PATCH] fixed deprecated api usage: issue #906 --- cached_network_image_web/lib/cached_network_image_web.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cached_network_image_web/lib/cached_network_image_web.dart b/cached_network_image_web/lib/cached_network_image_web.dart index 4e9655ce..e5c9c3ed 100644 --- a/cached_network_image_web/lib/cached_network_image_web.dart +++ b/cached_network_image_web/lib/cached_network_image_web.dart @@ -4,6 +4,7 @@ library cached_network_image_web; import 'dart:async'; import 'dart:typed_data'; import 'dart:ui' as ui; +import 'dart:ui_web'; import 'package:cached_network_image_platform_interface' '/cached_network_image_platform_interface.dart' as platform @@ -155,7 +156,7 @@ class ImageLoader implements platform.ImageLoader { ) { final resolved = Uri.base.resolve(url); // ignore: undefined_function - return ui.webOnlyInstantiateImageCodecFromUrl( + return createImageCodecFromUrl( resolved, chunkCallback: (int bytes, int total) { chunkEvents.add( @@ -165,7 +166,7 @@ class ImageLoader implements platform.ImageLoader { ), ); }, - ) as Future; + ); } }