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

flutter_sidekick-0.1.3/lib/src/widgets/sidekick_team_builder.dart:75:17: Error: The method 'ancestorStateOfType' isn't defined for the class 'BuildContext'. #12

Open
md84419 opened this issue Mar 7, 2021 · 1 comment

Comments

@md84419
Copy link

md84419 commented Mar 7, 2021

In flutter 2.x, I am seeing the following error message when attempting to use Sidekick:

flutter_sidekick-0.1.3/lib/src/widgets/sidekick_team_builder.dart:75:17: Error: The method 'ancestorStateOfType' isn't defined for the class 'BuildContext'.

Apparently context.ancestorStateOfType() and context.ancestorInheritedElementForWidgetOfExactType(type) are deprecated because they don't work correctly and have been removed for latest Flutter stable.

@pbouttier
Copy link

Hi

ancestorStateOfType is deprecated, simply replace it with findAncestorStateOfType like this https://stackoverflow.com/questions/59448102/ancestorstateoftype-is-deprecated-use-findancestorstateoftype-instead

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

No branches or pull requests

2 participants