Error: Type ‘DiagnosticableMixin‘ not found.

原作者没有写全,我来补一点。

原作者地址

Error: Type ‘DiagnosticableMixin‘ not found.
在这里插入图片描述
原因:flutter1.20.0+以上DiagnosticableMixin 被移除了。

解决办法:
进入到flutter的SDK目录下
比如:我的SDK目录
D:\Android\flutter\.pub-cache\hosted\pub.flutter-io.cn\flutter_cupertino_date_picker-1.0.26+2\lib\src

1.在lib/src/date_picker_theme.dart中找到DateTimePickerTheme类
2.将继承的DiagnosticableMixin 类替换为 Diagnosticable类
在这里插入图片描述
然后就能正常运行了

猜你喜欢

转载自blog.csdn.net/qq_46070108/article/details/115444338