The validator complains that dependencies only used inside a build hook (which is placed inside the top-level hook directory) should be dev_dependnecies (because they are only used outside of lib/). That is not correct as also stated in the documentation for hooks:
You need to add the dependencies under dependencies, not dev_dependencies. The hooks will be run by packages and applications depending on your package, so the Dart code needs to be part of the resolution in those packages.