Reputation: 102
I had installed provider package 3.1.0 and had this error while running.
/C:/Users/Praveen/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/delegate_widget.dart:194:18: Error: Superclass has no method named 'inheritFromElement'. return super.inheritFromElement(ancestor, aspect: aspect); ^^^^^^^^^^^^^^^^^^
/C:/Users/Praveen/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:259:19: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
/C:/Users/Praveen/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:260:19: Error: The method 'ancestorInheritedElementForWidgetOfExactType' isn't defined for the class 'BuildContext'.
FAILURE: Build failed with an exception.
Where: Script 'D:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'D:\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 23s Exception: Gradle task assembleDebug failed with exit code 1
Upvotes: 0
Views: 842
Reputation: 80904
Upgrade to the latest version of provider:
dependencies:
provider: ^6.0.0
Upvotes: 2