Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'. #17

Closed
wants to merge 1 commit into from

Conversation

mrdev023
Copy link

@mrdev023 mrdev023 commented Feb 11, 2021

When i try to compile i get this error

/C:/tools/flutter/.pub-cache/hosted/pub.dartlang.org/load-0.1.6/lib/src/theme.dart:16:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/tools/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(LoadingTheme);

Because in my version of flutter it's deleted.

I just replace inheritFromWidgetOfExactType by dependOnInheritedWidgetOfExactType recommended in flutter docs

https://api.flutter.dev/flutter/widgets/BuildContext/inheritFromWidgetOfExactType.html

@mrdev023
Copy link
Author

mrdev023 commented Mar 1, 2021

@CaiJingLong

1 similar comment
@shakir-fattani
Copy link

@CaiJingLong

@mrdev023 mrdev023 closed this Mar 29, 2021
@mrdev023
Copy link
Author

Patched

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants