0Pricing
Dart Academy · Lesson

Version Constraints and the Lockfile

Pin and resolve dependency versions.

Why Constraints Exist

A version constraint tells pub which releases of a package your project accepts. It balances getting fixes with avoiding breaking changes. 🎯

http: ^1.2.0

Semantic Versioning

Dart packages follow semantic versioning: major.minor.patch. A major bump signals breaking changes, minor adds features, patch fixes bugs.

version: 2.4.1

All lessons in this course

  1. Anatomy of pubspec.yaml
  2. Adding Dependencies With dart pub
  3. Imports, Exports, and Libraries
  4. Version Constraints and the Lockfile
← Back to Dart Academy