I already have a pre-commit hook in my project, but I want to force all people in my project to use it. For that purpose, I want to write a flutter library for creating files in a flutter project directory(like a husky in js world)! All that I have searched are about widgets libraries and so on!
I know that in js libraries in package.json there is a script object with install property. In this property, anybody can write to run a script. Is there an opportunity to do the same thing in dart or flutter?
You can apply Git hooks in Flutter projects using Lefthook. I've written about it here. However, a pre-commit hook can be bypassed with the --no-verify flag, so I'd suggest you to also integrate checks on a pipeline. I've written about this using GitHub Actions and GitLab CI in case you're using one of these services.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With