Consider Flutter framework revision abc123. When promoted from master to dev, it was given the tag 1.2.0-0.0.pre. It was then promoted as is to beta. It was then promoted as is to stable, and tagged 1.2.0.
When the flutter tool reports its version (to either flutter doctor, flutter --version, or usage), it parses the output of git describe --match *.*.* --tags --first-parent. In locally testing commits with multiple tags (e.g. 1.18.0-6.0.pre and 1.18.0), it seems to pick the correct tag (1.18.0), but I could not find documentation on how it resolves multiple tags on the same commit. This SO post also seems confusing.
To be safe, we should first check all tags on the current commit (e.g. git tag --contains HEAD), checking first for a stable tag, second for a dev/beta style tag. If none are found (i.e. we are on an untagged commit on master), fallback to using git describe.