The version constraint can be a concrete version number, a range, or a minimum or maximum constraint. Let's explore how it looks in each situation:
- Any/empty: Like the previous example, we can use this without a version constraint, for example, json_serializable: or json_serializable: any.
- Concrete version: We can add the specific version number we want to work with, for example, json_serializable: 2.0.1.
- Minimal bound: Here, we can add a minimum acceptable version of the package we want in two ways: json_serializable: '>1.0.0', where we accept any version later than the specified version (excluding the specified one), or json_serializable: '>=1.0.0', where we accept any version above or equal to the specified version. ...