Find and version bump outdated packages in Flutter (across major versions)

后端 未结 5 924
挽巷
挽巷 2021-01-03 23:46

Is there a way to list and update packages that have crossed a major version in pubspec.yaml? (like this method used in NPM)

E.g. when the pubspec.yaml file has this

5条回答
  •  Happy的楠姐
    2021-01-04 00:18

    Flutter currently doesn't provide such a feature.
    There might be 3rd-party packages that do that. The only one I know is den (https://pub.dartlang.org/packages/den), but this one is not maintained since quite some time and can't be used with recent Dart or Flutter versions.

    What might help is to at least get a list of dependencies where newer versions are available.

    Upvote https://github.com/flutter/flutter/issues/12627 for that.

    In the meantime the workaround mentioned in https://github.com/flutter/flutter/issues/12627#issuecomment-400037072 can be used

    Set FLUTTER_ROOT to your Flutter install directory and run pub upgrade. (this requires the Dart SDK to be installed in addition to the Flutter SDK)

    $ export FLUTTER_ROOT="/Users/my_user/flutter"
    
    $ pub upgrade
    Resolving dependencies... (16.2s)
    ! analyzer 0.33.0 (overridden) (0.34.2 available)
      args 1.5.1
      async 2.0.8
      boolean_selector 1.0.4
    ! build 1.1.0 (overridden)
      built_collection 4.1.0
    ! built_redux 7.5.2 (overridden)
      built_value 6.2.0
      bwu_grinder_tasks 0.2.0-dev.0
      charcode 1.1.2
      cli_util 0.1.3+2
      collection 1.14.11
      contacts_service 0.0.9 (0.1.0 available)
    > convert 2.1.1 (was 2.0.2)
      crypto 2.0.6
      csslib 0.14.6
      dart_style 1.2.2
      device_info 0.2.1 (0.3.0 available)
    > file 5.0.7 (was 5.0.6)
    > firebase_analytics 1.1.0 (was 1.0.6)
    ...
    

提交回复
热议问题