flutter_in_action_source_code icon indicating copy to clipboard operation
flutter_in_action_source_code copied to clipboard

代码缺少实现 ChangeNotifier 类

Open jsonz1993 opened this issue 5 years ago • 1 comments

7.3 跨组件状态共享(Provider)的时候发现跑不了,来跑代码,拉下来之后发现项目里面好像缺少实现 ChangeNotifier

Undefined class 'ChangeNotifier'. Try changing the name to the name of an existing class, or creating a class with the name 'ChangeNotifier'.

基于这个commit的最新代码 commit

jsonz1993 avatar Oct 17 '19 07:10 jsonz1993

可能是版本的太低的问题, 我的是有的, 在包 flutter/packages/flutter/lib/src/foundation 下, 我的版本是 environment: sdk: ">=2.1.0 <3.0.0"

bdpqchen avatar Dec 30 '19 17:12 bdpqchen