brianegan / flutter_redux

A library that connects Widgets to a Redux Store
MIT License
1.65k stars 219 forks source link

Error: The method 'ancestorInheritedElementForWidgetOfExactType' isn't defined for the class 'BuildContext' #203

Closed hillelcoren closed 3 years ago

hillelcoren commented 3 years ago

Hi Brian,

We've started seeing this error when building on Flutter dev and master

../../.pub-cache/hosted/pub.dartlang.org/flutter_redux-0.6.0/lib/flutter_redux.dart:77:19: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../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)                    
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^                          
../../.pub-cache/hosted/pub.dartlang.org/flutter_redux-0.6.0/lib/flutter_redux.dart:79:14: Error: The method 'ancestorInheritedElementForWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../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'.
            .ancestorInheritedElementForWidgetOfExactType(type)         
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^          

I'm seeing similar problems for other packages on Stack Overflow

https://stackoverflow.com/questions/65657716/error-the-method-ancestorstateoftype-isnt-defined-for-the-class-buildcontex

hillelcoren commented 3 years ago

Hmm.. I see this change, we must be using an old version

https://github.com/brianegan/flutter_redux/commit/4197c966c527f7da136bf118b08e2e9429974e47