-
Couldn't load subscription status.
- Fork 1.7k
Description
The SDK uses a custom annotation for warnings: @Since('version').
This warning is helpful to help folks with changing their version constraints to match what they use in their application.
This is especially useful in Dart as it is installed globally instead of on a per-project basis. But there are other use-cases.
I think opening this annotation to Flutter and package authors would be helpful too.
In general, it is very difficult to know what is the actual minimum version possible of a dependency based on what a package uses.
A package may specify dependency: ^1.0.0, yet use a feature only available since v1.2.0 – because when the package was first developed, 1.2.0 was available.
As such, the package author may think their package is compatible with dependency: 1.1.0, when it actually isn't. So if an application depends on our package but also uses an older dependency version, it will get a funky compilation error (in the best-case scenario) instead of pub failing to resolve the pub get.
By opening up this annotation to package authors, folks could start annotating new APIs with @Since when they are introduced. This would help the community as a whole deal with minimum version constraints.