I hate fungus gnats too! My tips:
1. Water less - Top soil needs to dry out every so often to kill larva. Throw some diatomaceous earth on the top also if you have some to allow the topsoil to dry out quicker.
2. Have good drainage, rocks/perlite at the bottom of potted plants. I had gnats breeding using the drainage holes at the bottom, don't give them organic material to feed on there.
3. Buy some Nematoads, products like this may be sold at your Hydroponics store:
http://www.homedepot.com/p/Nema-globe-3000-sq-ft-Coverage-Grub-Busters-Natural-Grub-Eliminator-8003002/203148153 . Water the packets and nematoads are slowly released into the soil, feeding on gnat larvae and won't hurt your plant! I'd actually recommend using this as a preventative measure also before gnats even appear if you're growing a seedling in a large 3 gallon + pot.
4. Sand that topsoil. Get some play sand, put a 1/2 inch layer at least on top, the larvae can't escape and become gnats so the cycle should stop. Note sanding the topsoil only works if you have good drainage as mentioned, otherwise your flies will breed below and it's much harder to address. Sand will start to creep down the side walls of the container overtime, your plants roots won't mind but you can always re-pot the plant later. I don't much like the look of sand on the topsoil (it's alright i guess) but it looks
much better than gnats do.
5. Buy yellow sticky traps:
https://www.amazon.com/Safer-Houseplant-Sticky-Stakes-Insect/dp/B000OV8OTY , this will help slow don't the infestation but don't expect it to prevent anything entirely.
6. Water plants at the same time, and divide and conquer i.e put plants in different rooms if you can.
7. Keep a clean grow room, remove excess water, don't mist the room too often either.
People also recommend sprays, burying a potato slice in the ground etc, but the above is usually enough for me.
Remember, the flies don't hurt your plant, their larvae which lays 1000s of eggs that will start eating your plants roots once they run out of food are the real pest.