Closed RedSevenMale closed 1 year ago
你Flutter的版本是?
Flutter 3.9.0-15.0.pre.22 • channel main • https://github.com/flutter/flutter.git Framework • revision 250a6c2942 (2 hours ago) • 2023-03-23 05:47:28 -0400 Engine • revision 59acb53620 Tools • Dart 3.0.0 (build 3.0.0-358.0.dev) • DevTools 2.22.2 切换beta、stable都报错
你这有点超前了( stable频道应该是没有问题的
我也在 city_pickers-1.2.1 中遇到了这个问题 可以修改 /Pub/Cache/hosted/pub.dev/city_pickers-1.2.1/lib/cities_selector.dart 117 行 theme.colorScheme.secondary, //theme.accentColor,
Fixed by #160.
Consider use git version before new release.
dependencies:
city_pickers: # FIXME: Use latest version instead after the commit release.
git:
url: https://github.com/hanxu317317/city_pickers
ref: 8a702e52d52e17df9995353748b3dfe088f27de9
我试了上上面的方法,还是报错: /C:/Users/18661/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/city_pickers-1.2.1/lib/src/cities_selector/cities_selector.dart:116:48: Error: The getter 'accentColor' isn't defined for the class 'ThemeData'.
这是在修改源码吗
是的,这是在修改包代码,这不是推荐的方式;但你可以将 theme.accentColor 改为 theme.colorScheme.secondary 修复这个问题
感谢分享~问题已解决
/city_pickers-1.2.1/lib/src/cities_selector/cities_selector.dart:116:48: Error: The getter 'accentColor' isn't defined for the class 'ThemeData'.