Ok, from flutter doc (https://dart.dev/tools/pub/dependencies):
If you want to depend on a specific commit, branch, or tag, add a ref
argument:
dependencies:
kittens:
git:
url: git://github.com/munificent/kittens.git
ref: some-branch
The ref can be anything that Git allows to identify a commit.