Search code examples
flutterdartdart-pubsemantic-versioning

What is the recommended way to add plugin version in pubspec.yaml?


Using caret (^) sign -

plugin_name : ^10.0.0

Without using caret (^) sign -

plugin_name : 10.0.0

As The ^ sign is used to automatically use the most up-to-date package from Pub as long as that update won't break anything in the app. However, it is possible that the updated package could introduce new bugs?

Without the ^ sign will always use the same version of the package from Pub, which can help prevent the introduction of new bugs. If we want to update the package, we will need to manually specify the new version.

So what is the recommended way to add plugin versions to avoid plugin errors / conflicts, while ensuring all plugins remain up-to-date?


Solution

  • The safest way is to use the explicit version:

    plugin_name : 10.0.0
    

    With this you can be sure everything works as it should, if you want to update one package do it by increasing version number by yourself.