0

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;
  }
}
GreenCodeSki
  • 649
  • 1
  • 6
  • 11

1 Answers1

0

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;

dev-aentgs
  • 1,218
  • 2
  • 9
  • 17