flutter_sidekick icon indicating copy to clipboard operation
flutter_sidekick copied to clipboard

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'.

Open md84419 opened this issue 5 years ago • 1 comments

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.

md84419 avatar Mar 07 '21 13:03 md84419

Hi

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

pbouttier avatar Aug 30 '21 10:08 pbouttier