missing concrete implementation of InheritedWidget.updateShouldNotify

350 views Asked by At

I am following a flutter tutorial and it's an old one so I already had to make changes as per the changes in dart and some libraries but I am getting this error and the guy in tutorial gets no such error there. PS: its the only place where "StoriesProvider is getting defined"

class StoriesProvider extends InheritedWidget { //Missing concrete implementation of InheritedWidget.updateShouldNotify here
  final StoriesBloc bloc;

  StoriesProvider({Key key, Widget child})
      : bloc = StoriesBloc(),
        super(key: key, child: child);

  bool updateSouldNotify(_) => true;

  static StoriesBloc of(BuildContext context) {
    return (context.dependOnInheritedWidgetOfExactType<StoriesProvider>(
            ))
        .bloc;
  }
}
1

There are 1 answers

0
dev-aentgs On

There is a typo in your code updateSouldNotify should be updateShouldNotify . This should fix the issue.

The flutter documentation has an Example .

@override bool updateShouldNotify(FrogColor old) => color != old.color;