我正在关注一个颤振教程,它是一个旧教程,所以我已经不得不根据 dart 和一些库中的更改进行更改,但是我收到了这个错误,教程中的那个人在那里没有遇到这样的错误。PS:它是“StoriesProvider 被定义”的唯一地方
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;
}
}