尝试通过ExtendedImage插件运行我的应用时出现编译器错误

时间:2019-12-28 11:08:30

标签: flutter dart

正如标题所述,当我尝试运行我的应用程序时,出现编译器错误消息。在重置笔记本电脑之前,我已经进行了此工作(但是保留了所有文件)。我已经尝试进行抖动清除,并尝试将Extended_image更新到最新版本(0.6.8),但是仍然无法正常工作,因此我将其降级为0.6.7。

此外,我只安装了extended_image,而没有extended_image_library。看起来Extended_image会自行安装。

以下是消息:

Compiler message:
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_network_image_provider.dart:63:41: Error: Type 'DecoderCallback' not found.
      ExtendedNetworkImageProvider key, DecoderCallback decode) {
                                        ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_network_image_provider.dart:87:41: Error: Type 'DecoderCallback' not found.
      ExtendedNetworkImageProvider key, DecoderCallback decode) async {
                                        ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_image_provider.dart:14:23: Error: Type 'DecoderCallback' not found.
      Uint8List data, DecoderCallback decode) async {
                      ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_memory_image_provider.dart:12:46: Error: Type 'DecoderCallback' not found.
  ImageStreamCompleter load(MemoryImage key, DecoderCallback decode) {
                                             ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_memory_image_provider.dart:19:48: Error: Type 'DecoderCallback' not found.
  Future<ui.Codec> _loadAsync(MemoryImage key, DecoderCallback decode) {
                                               ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_file_image_provider.dart:13:44: Error: Type 'DecoderCallback' not found.
  ImageStreamCompleter load(FileImage key, DecoderCallback decode) {
                                           ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_file_image_provider.dart:23:46: Error: Type 'DecoderCallback' not found.
  Future<ui.Codec> _loadAsync(FileImage key, DecoderCallback decode) async {
                                             ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_asset_bundle_image_provider.dart:35:54: Error: Type 'DecoderCallback' not found.
  ImageStreamCompleter load(AssetBundleImageKey key, DecoderCallback decode) {
                                                     ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_asset_bundle_image_provider.dart:52:32: Error: Type 'DecoderCallback' not found.
      AssetBundleImageKey key, DecoderCallback decode) async {
                               ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_asset_bundle_image_provider.dart:88:54: Error: Type 'DecoderCallback' not found.
  ImageStreamCompleter load(AssetBundleImageKey key, DecoderCallback decode) {
                                                     ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_asset_bundle_image_provider.dart:105:32: Error: Type 'DecoderCallback' not found.
      AssetBundleImageKey key, DecoderCallback decode) async {
                               ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_memory_image_provider.dart:12:24: Error: The method 'ExtendedMemoryImageProvider.load' has more required arguments than those of overridden method 'MemoryImage.load'.
  ImageStreamCompleter load(MemoryImage key, DecoderCallback decode) {
                       ^
/C:/src/flutter/packages/flutter/lib/src/painting/image_provider.dart:596:24: Context: This is the overridden method ('load').
  ImageStreamCompleter load(MemoryImage key) {
                       ^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_file_image_provider.dart:13:24: Error: The method 'ExtendedFileImageProvider.load' has more required arguments than those of overridden method 'FileImage.load'.
  ImageStreamCompleter load(FileImage key, DecoderCallback decode) {
                       ^
/C:/src/flutter/packages/flutter/lib/src/painting/image_provider.dart:528:24: Context: This is the overridden method ('load').
  ImageStreamCompleter load(FileImage key) {
                       ^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_asset_bundle_image_provider.dart:35:24: Error: The method 'ExtendedExactAssetImageProvider.load' has more required arguments than those of overridden method 'AssetBundleImageProvider.load'.
  ImageStreamCompleter load(AssetBundleImageKey key, DecoderCallback decode) {
                       ^
/C:/src/flutter/packages/flutter/lib/src/painting/image_provider.dart:447:24: Context: This is the overridden method ('load').
  ImageStreamCompleter load(AssetBundleImageKey key) {
                       ^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_asset_bundle_image_provider.dart:88:24: Error: The method 'ExtendedAssetImageProvider.load' has more required arguments than those of overridden method 'AssetBundleImageProvider.load'.
  ImageStreamCompleter load(AssetBundleImageKey key, DecoderCallback decode) {
                       ^
/C:/src/flutter/packages/flutter/lib/src/painting/image_provider.dart:447:24: Context: This is the overridden method ('load').
  ImageStreamCompleter load(AssetBundleImageKey key) {
                       ^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_network_image_provider.dart:62:24: Error: The method 'ExtendedNetworkImageProvider.load' has more required arguments than those of overridden method 'ImageProvider.load'.
  ImageStreamCompleter load(
                       ^
/C:/src/flutter/packages/flutter/lib/src/painting/image_provider.dart:383:24: Context: This is the overridden method ('load').
  ImageStreamCompleter load(T key);
                       ^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image-0.6.8/lib/src/gesture/extended_image_gesture.dart:97:19: Error: The method 'findAncestorStateOfType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'findAncestorStateOfType'.
          context.findAncestorStateOfType<ExtendedImageGesturePageViewState>();
                  ^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image-0.6.8/lib/src/gesture/extended_image_gesture.dart:108:19: Error: The method 'findAncestorStateOfType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'findAncestorStateOfType'.
          context.findAncestorStateOfType<ExtendedImageGesturePageViewState>();
                  ^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image-0.6.8/lib/src/extended_image.dart:659:19: Error: The method 'findAncestorStateOfType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'findAncestorStateOfType'.
          context.findAncestorStateOfType<ExtendedImageSlidePageState>();
                  ^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image-0.6.8/lib/src/extended_image.dart:681:14: Error: The method 'findAncestorStateOfType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'findAncestorStateOfType'.
            .findAncestorStateOfType<ExtendedImageSlidePageState>();
             ^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_network_image_provider.dart:63:41: Error: 'DecoderCallback' isn't a type.
      ExtendedNetworkImageProvider key, DecoderCallback decode) {
                                        ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_network_image_provider.dart:87:41: Error: 'DecoderCallback' isn't a type.
      ExtendedNetworkImageProvider key, DecoderCallback decode) async {
                                        ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_image_provider.dart:14:23: Error: 'DecoderCallback' isn't a type.
      Uint8List data, DecoderCallback decode) async {
                      ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_memory_image_provider.dart:12:46: Error: 'DecoderCallback' isn't a type.
  ImageStreamCompleter load(MemoryImage key, DecoderCallback decode) {
                                             ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_memory_image_provider.dart:19:48: Error: 'DecoderCallback' isn't a type.
  Future<ui.Codec> _loadAsync(MemoryImage key, DecoderCallback decode) {
                                               ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_file_image_provider.dart:13:44: Error: 'DecoderCallback' isn't a type.
  ImageStreamCompleter load(FileImage key, DecoderCallback decode) {
                                           ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_file_image_provider.dart:23:46: Error: 'DecoderCallback' isn't a type.
  Future<ui.Codec> _loadAsync(FileImage key, DecoderCallback decode) async {
                                             ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_asset_bundle_image_provider.dart:35:54: Error: 'DecoderCallback' isn't a type.
  ImageStreamCompleter load(AssetBundleImageKey key, DecoderCallback decode) {
                                                     ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_asset_bundle_image_provider.dart:52:32: Error: 'DecoderCallback' isn't a type.
      AssetBundleImageKey key, DecoderCallback decode) async {
                               ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_asset_bundle_image_provider.dart:88:54: Error: 'DecoderCallback' isn't a type.
  ImageStreamCompleter load(AssetBundleImageKey key, DecoderCallback decode) {
                                                     ^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/extended_image_library-0.1.9/lib/src/extended_asset_bundle_image_provider.dart:105:32: Error: 'DecoderCallback' isn't a type.
      AssetBundleImageKey key, DecoderCallback decode) async {
                               ^^^^^^^^^^^^^^^
Compiler failed on C:\Users\Ken\Documents\flutter_projects\project_name\lib\main.dart

FAILURE: Build failed with an exception.

* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 765

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebugX86'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s
Finished with error: Gradle task assembleDebug failed with exit code 1

Flutter Doctor输出

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel unknown, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.18362.535], locale en-GB)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.5)
[√] VS Code, 64-bit edition (version 1.41.1)
[√] Connected device (1 available)

• No issues found!


0 个答案:

没有答案