Closed h1amza closed 9 months ago
@vintage @xrusu @wenxiangjiang @andersonmendess can u help plz?
The Problem is in _loadImage logic (widget.dart) because imageProvider.load is now imageProvider.loadImage
i fix that :
// Asynchronously loads an image and returns a Future of ui.Image.
Future<ui.Image> _loadImageAsync(Image imageWidget) async {
// Create a completer to manage the asynchronous operation.
final Completer<ui.Image> imageCompleter = Completer<ui.Image>();
// Obtain the image provider from the Image widget.
final ImageProvider imageProvider = imageWidget.image;
// Obtain a key for the image.
final imageKey = await imageProvider.obtainKey(ImageConfiguration.empty);
// Load the image using the obtained key.
imageProvider.loadImage(
imageKey,
(ui.ImmutableBuffer buffer, {ui.TargetImageSizeCallback? getTargetSize}) {
return ui.instantiateImageCodecFromBuffer(buffer);
},
).addListener(ImageStreamListener((ImageInfo image, _) {
imageCompleter.complete(image.image);
}));
// Return the future from the completer.
return imageCompleter.future;
}
is that fixed?
Fixed in 2.5.0
My code:![Capture0](https://github.com/vintage/scratcher/assets/32615603/b579fa1a-ff65-4bef-bcec-ab6df33d2e1f)
Console output:![Capture](https://github.com/vintage/scratcher/assets/32615603/674ecd4a-e1be-41e7-b3a7-8d1f756ebc10)