Not found: 'package:image/image.dart' import 'package:image/image.dart' as image;
live17909 opened this issue · comments
Compiler message:
Error: Could not resolve the package 'image' in 'package:image/image.dart'.
lib/category/animation/simulation/particle.dart:9:8: Error: Not found: 'package:image/image.dart'
import 'package:image/image.dart' as image;
^
lib/category/animation/simulation/particle.dart:92:28: Error: Type 'image.Image' not found.
void separatePixels(List<image.Image> blankLayers, image.Image fullImage, int width, int height) {
^^^^^^^^^^^
lib/category/animation/simulation/particle.dart:92:54: Error: Type 'image.Image' not found.
void separatePixels(List<image.Image> blankLayers, image.Image fullImage, int width, int height) {
^^^^^^^^^^^
lib/category/animation/simulation/particle.dart:103:10: Error: Type 'image.Image' not found.
Future<image.Image> convertWidget2Image() async {
^^^^^^^^^^^
lib/category/animation/simulation/particle.dart:111:30: Error: Type 'image.Image' not found.
Widget convertImage2Widget(image.Image png) {
^^^^^^^^^^^
lib/category/animation/simulation/particle.dart:82:11: Error: 'Image' isn't a type.
image.Image fullImage = await convertWidget2Image();
^^^^^
lib/category/animation/simulation/particle.dart:85:16: Error: 'Image' isn't a type.
List<image.Image> blankLayers = List.generate(widget.numberOfLayers, (i) => image.Image(width, height));
^^^^^
lib/category/animation/simulation/particle.dart:85:81: Error: Method not found: 'Image'.
List<image.Image> blankLayers = List.generate(widget.numberOfLayers, (i) => image.Image(width, height));
^^^^^
lib/category/animation/simulation/particle.dart:92:34: Error: 'Image' isn't a type.
void separatePixels(List<image.Image> blankLayers, image.Image fullImage, int width, int height) {
^^^^^
lib/category/animation/simulation/particle.dart:92:60: Error: 'Image' isn't a type.
void separatePixels(List<image.Image> blankLayers, image.Image fullImage, int width, int height) {
^^^^^
lib/category/animation/simulation/particle.dart:108:12: Error: Method not found: 'decodeImage'.
return image.decodeImage(pngBytes);
^^^^^^^^^^^
lib/category/animation/simulation/particle.dart:111:36: Error: 'Image' isn't a type.
Widget convertImage2Widget(image.Image png) {
^^^^^
lib/category/animation/simulation/particle.dart:112:41: Error: Method not found: 'encodePng'.
Uint8List data = Uint8List.fromList(image.encodePng(png));
^^^^^^^^^
lib/category/widgets/touchinteractions/dragtarget.dart:86:28: Error: The argument type 'Null Function(double)' can't be assigned to the parameter type 'void Function(Object)'.
- 'Object' is from 'dart:core'.
onLeave: (double value) {
^
请确定在stable分支
For those who still receive this message: you need to add image: ^3.0.8
to pubspec.yaml
or whatever version your require.
See here how to install https://pub.dev/packages/image/install