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

后端 未结 5 921
挽巷
挽巷 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条回答
  •  时光取名叫无心
    2021-01-04 00:31

    Use pub outdated to identify out-of-date package dependencies and get advice on how to update them. Best practices for dependency management include using the most recent stable package versions, so you can get the latest bug fixes and improvements.

    The pub outdated command was introduced in Dart 2.8.

    Outdated is one of the commands of the pub tool

    flutter pub outdated 
    

    Output columns

    The output of pub outdated has four columns of version information for each out-of-date dependency. Here is the part of the example output that shows the four version columns: Current, Upgradable, Resolvable, and Latest.

    Current The version used in your package, as recorded in pubspec.lock. If the package isn’t in pubspec.lock, the value is -.

    Upgradable The latest version allowed by your pubspec.yaml file. This is the version that pub upgrade resolves to. The value is - if the value in the Current column is -.

    Resolvable The latest version that can be resolved, when combined with all other dependencies. This version corresponds to what pub upgrade gives you if all version constraints in pubspec.yaml are unbounded. A value of - means that the package won’t be needed.

    Latest The latest version of the package available, excluding prereleases unless you use the option --prereleases.

提交回复
热议问题