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 418845c0..7922eb1e 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; + ); } }