Flutter Flatter/Dart copyCrop函数异常:无法实例化图像编解码器
我想在flatter中显示一个裁剪过的图像。我使用Image.memory小部件。当我使用原始图像时,没有问题Flutter Flatter/Dart copyCrop函数异常:无法实例化图像编解码器,flutter,dart,Flutter,Dart,我想在flatter中显示一个裁剪过的图像。我使用Image.memory小部件。当我使用原始图像时,没有问题 var tempStore = await ImagePicker.pickImage(source: ImageSource.camera); List<int> byteListe = await tempStore.readAsBytes(); image = dartimage.Image.fromBytes(400, 400, byte
var tempStore = await ImagePicker.pickImage(source: ImageSource.camera);
List<int> byteListe = await tempStore.readAsBytes();
image = dartimage.Image.fromBytes(400, 400, byteList);
这是个例外
════════ Exception caught by image resource service ════════════════════════════════════════════════
The following _Exception was thrown while resolving an image:
Exception: Could not instantiate image codec.
When the exception was thrown, this was the stack:
#0 _futurize (dart:ui/painting.dart:4304:5)
#1 instantiateImageCodec (dart:ui/painting.dart:1682:10)
#2 PaintingBinding.instantiateImageCodec (package:flutter/src/painting/binding.dart:88:12)
#3 MemoryImage._loadAsync (package:flutter/src/painting/image_provider.dart:714:18)
#4 MemoryImage.load (package:flutter/src/painting/image_provider.dart:706:14)
...
Image provider: MemoryImage(_Uint8ArrayView#a573e, scale: 1.0)
Image configuration: ImageConfiguration(bundle: PlatformAssetBundle#c13af(), devicePixelRatio: 4.0, locale: de_DE, textDirection: TextDirection.ltr, platform: android)
Image key: MemoryImage(_Uint8ArrayView#a573e, scale: 1.0)
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by image resource service ════════════════════════════════════════════════
The following _Exception was thrown while resolving an image:
Exception: Could not instantiate image codec.
When the exception was thrown, this was the stack:
#0 _futurize (dart:ui/painting.dart:4304:5)
#1 instantiateImageCodec (dart:ui/painting.dart:1682:10)
#2 PaintingBinding.instantiateImageCodec (package:flutter/src/painting/binding.dart:88:12)
#3 MemoryImage._loadAsync (package:flutter/src/painting/image_provider.dart:714:18)
#4 MemoryImage.load (package:flutter/src/painting/image_provider.dart:706:14)
...
Image provider: MemoryImage(_Uint8ArrayView#a573e, scale: 1.0)
Image configuration: ImageConfiguration(bundle: PlatformAssetBundle#c13af(), devicePixelRatio: 4.0, locale: de_DE, textDirection: TextDirection.ltr, platform: android)
Image key: MemoryImage(_Uint8ArrayView#a573e, scale: 1.0)
════════════════════════════════════════════════════════════════════════════════════════════════════