Pub, naturally, has its own pure Dart implementation of semver, including nice classes for representing versions, version ranges, and version constraints. This code has been in the bowels of pub forever.
Users that want to write Dart code that works with versions have asked us to pull this out into a separate package but I never seemed to find the time. I finally did!
The
pub_semver package is ready for all of your purposes, both innocent and nefarious. It's well-tested, quite stable, and I think easy to use. It has "pub" in the name because it is
not a pure spec-compliant implementation of
semver. You can see details on where it diverges and why
in the README.
Contributions to this are absolutely welcome!
The source code lives on github here. Feel free to file issues there, send pull requests, etc. As you can imagine, stability and compatibility are pretty important here so expect us to be excited to have you participate but with a high bar for quality. :)
Cheers!
- bob