Here’s a solution I found online for anyone in dependency hell:

In pubspec.yaml, set the offending dependencies to version “any” (i.e. “build_runner: any”) and then do pub get. Then, go into your pubspec.lock file and command f that package (in this case, build runner) then take the version that pub solved and put it in your pubspec.yaml and you’re good to go!