hanxu317317 / city_pickers

flutter ios city_pickers
MIT License
374 stars 195 forks source link

编译报错 #156

Closed RedSevenMale closed 1 year ago

RedSevenMale commented 1 year ago

/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'.

image

ipcjs commented 1 year ago

你Flutter的版本是?

RedSevenMale commented 1 year ago

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都报错

ipcjs commented 1 year ago

你这有点超前了( stable频道应该是没有问题的

ltq918 commented 1 year ago

我也在 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,

kj415j45 commented 1 year ago

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
huakaihualuo01 commented 1 year ago

我试了上上面的方法,还是报错: /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'.

huakaihualuo01 commented 1 year ago

这是在修改源码吗

ltq918 commented 1 year ago

是的,这是在修改包代码,这不是推荐的方式;但你可以将 theme.accentColor 改为 theme.colorScheme.secondary 修复这个问题

huakaihualuo01 commented 1 year ago

感谢分享~问题已解决