Relative Content

Tag Archive for flutterdependenciesflutter-dependenciesdependency-managementpubspec.yaml

Flutter pubspec.yaml dependency selection algorithm

in my flutter project I have injectable_generator: ^2.4.1 in the pubspec.yaml file, while the latest version on the pub dev is currently injectable_generator: ^2.6.1, and the question is, by what mechanism does flutter select the dependencies that will eventually be installed generated in pubspec.lock because it ends up with the injectable_generator version:
dependency: “direct dev”
description:
name: injectable_generator
sha256: ac28d612899beda76a6375cb42dc6655a8c3ce3606cc53c25649e3c101d5d41a
url: “https://pub.dev”
source: hosted
version: “2.5.1”
Here’s the answer please, how does flutter do this, looks at the pubspec, then where does it go, to the pub.dev? and does pubspec.lock already generate the required version? then the main question is why and how did he decide to take not the latest version 2.6.1, but took 2.5.1, what algorithm is he guided by, what does he look at?my Pubspec.yaml[versions of libraryPubspec.lock](https://i.sstatic.net/oTZVJHyA.png)