flutter2.x中使用city_pickers报错如何解决

发布于 3 年前 作者 phonegap100 1075 次浏览 最后一次编辑是 3 年前 来自 分享

flutter2.x中使用city_pickers会报错 ,错误提示如下:


/F:/flutter_windows/flutter_windows_2.2.0/.pub-cache/hosted/pub.flutter-io.cn/city_pickers-0.2.0/lib/src/cities_selector/cities_selector.dart:415:9: Error: No named parameter with the name 'resizeToAvoidBottomPadding'.
        resizeToAvoidBottomPadding: false,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
/F:/flutter_windows/flutter_windows_2.2.0/packages/flutter/lib/src/material/scaffold.dart:1466:9: Context: Found this candidate, but the arguments don't match.
  const Scaffold({
        ^^^^^^^^                                                                        

解决办法:

方法1、android studio打开项目修改本地插件,参考:https://github.com/hanxu317317/city_pickers/issues/123

方法2、使用修改好的插件,通过下面方式配置插件:

  city_pickers: 
   git:
      url: http://github.com/phonegap100/city_pickers
回到顶部