You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在现有Flutter项目中更新Dart版本解决flutter_iconpicker依赖问题

Solution to flutter_iconpicker Version Conflict

The core issue here is that your project's SDK constraint in pubspec.yaml is still locked to versions below 3.0.0, which clashes with flutter_iconpicker >=3.2.3 requiring Dart SDK 3.0.0 or higher—even though you've updated your global Flutter/Dart installation.

Here's how to fix it:

  • Open your project's pubspec.yaml file.
  • Locate the environment section and update the SDK constraint to match your installed Dart version (3.0.3):
    environment:
      sdk: '>=3.0.0 <4.0.0'
    
    For exact compatibility, you can use:
    environment:
      sdk: '>=3.0.3 <4.0.0'
    
  • Save the file.
  • Run flutter pub get in your project directory.

If you encounter version conflicts with other dependencies after this update, upgrade those packages to their latest versions that support Dart 3.0. Most modern Flutter packages have already been updated to work with Dart 3, so this should resolve most issues.

内容的提问来源于stack exchange,提问作者furkanYagmur

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.18 18:23:00