ошибки сборки флаттера Метод inheritFromWidgetOfExactType

avatar
Elga Zar
8 августа 2021 в 21:08
56
0
0
/C:/Program%20Files/flutter/.pub-cache/hosted/pub.dartlang.org/provider-2.0.1+1/lib/src/provider.dart:179:19: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/Program%20Files/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
        ? context.inheritFromWidgetOfExactType(type) as _Provider<T>
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/Program%20Files/flutter/.pub-cache/hosted/pub.dartlang.org/provider-2.0.1+1/lib/src/provider.dart:180:19: Error: The method 'ancestorInheritedElementForWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/Program%20Files/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'ancestorInheritedElementForWidgetOfExactType'.
        : context.ancestorInheritedElementForWidgetOfExactType(type)?.widget
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'C:\Program Files\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Program Files\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 6m 58s
Exception: Gradle task assembleDebug failed with exit code 1

изображение 1

изображение 2

Источник
Nolence
9 августа 2021 в 22:06
0

Пожалуйста, добавьте свой код, вызвавший ошибку, и вопрос, который у вас есть.

Ответы (0)