Rinse the Bin Often:
Yeah, it’s annoying. But one quick rinse with water and vinegar once a week can stop the build-up of gunk and odors flies are attracted to.
Use Trash Bin Liners:
Liners are an easier way to clean up after your dog and to prevent leaking that becomes maggot heaven.
Keep the Lid Closed:
It sounds obvious, but even leaving the lid cracked gives flies an opportunity to crawl in. Always snap it shut.
DE/Diatomaceous Earth or Bay Leaves:
Add a dusting of diatomaceous earth (DE) or toss in a couple of bay leaves in there. Both are hated by flies as well, and DE also kills larvae by dehydrating them.