I've had success using straight isopropyl alcohol in a spray bottle. I direct the spray to the surface of the potting medium, as that is where they live and breed.
If a little gets on the leaves it won't hurt the plant.
common house spiders will also take care of fungus gnats if you let them build webs around your grow area. i don't know how you get them in the first place but once they make it inside, they will set up shop and help you out.
Another trick I use is to float a mosquito dunk in my water. (Can't do that if you water from the tap ) I keep rainwater in 5 gallon pails. Mosquito dunks prevent the larvae from growing into adults.
Another trick is to aim a gentle breeze from a fan over your growing area. The adults are not strong fliers, and if constantly blown away from the plants they will not be able to lay eggs. Soon the remaining larvae will mature and the population will entirely blow away. People who grow cactus from seed indoors under lights use this trick.
And one day at the office I saw a can of tick spray intended for dogs. I asked whether anybody there had ticks. I was informed "everybody" knew tick spray on the soil would kill the little gnats flying around house plants.
__________________ May the bridges I've burned light my way.