编译报错:
Compiler message:
/D:/Program%20Files/flutter/.pub-cache/hosted/pub.flutter-io.cn/cached_network_image-1.1.1/lib/src/cached_network_image_provider.dart:42:24: Error: The method ‘CachedNetworkImageProvider.load’ has fewer positional arguments than those of overridden method ‘ImageProvider.load’.
ImageStreamCompleter load(CachedNetworkImageProvider key) {
^
/D:/Program%20Files/flutter/packages/flutter/lib/src/painting/image_provider.dart:403:24: Context: This is the overridden method (‘load’).
ImageStreamCompleter load(T key, DecoderCallback decode);
发现是由于cached_network_image版本低引起的,打开pubspec.yaml文件,修改cached_network_image版本从原来的 1.1.1修改为2.0.0-rc,然后点击Get Packages完成后,重新运行。