Is it a good idea to use a Venus flytrap to catch flying pests?
If you are counting on pest control, that won’t work, sorry.
First, fungus gnats and mosquitoes are just too small and lightweight to trigger the traps. If you want to catch such little insects, something sticky is much better, that would be for example sundews (drosera) or butterworts (pinguicula).
Second, insectivorous plants still get their energy from photosynthesis, their “prey” is just a supplementary source of nutrients that their natural habitat doesn’t provide via the soil. Speaking from experience, they will catch some insects, but not remotely an amount that would be noticeable if you have lots of them around and for just a few mosquitoes, the probability of them being caught is low enough that a plain old fly swatter is the more promising method of pest control.