I've had this problem during the last heatwave, despite net curtains and windows closed.
Check houseplants. I moved a house plant (aloe Vera, not wet compost so not sure why they chose that) on my kitchen window sill. A cloud of fruit flies flew up .and almost choked me!
I have a fly curtain on my back door, the sort that use magnets to snap closed as you pass through, dead cheap, can be drawing pinned or velcroed up, and that help a lot with the bigger flies.
That and sticky hanging fly papers work very well. Cover fruit bowls with a muslin or one of those umbrella type cake covers.
Keep veg in the fridge and cover in a linnen or cotyon veg bag. I made some out of charity shop linnen napkins , cost me about a pound a napkin and half an hour on the sewing machine. I have one for onions, one for potatoes one for carrots, and one for other veg. Used a permanent marker to label them .
I've even found fruit flies in my fridge. Wash any stuff you might put in there before storing. The fruit fly eggs can already be on things, and they will hatch in the fridge.
Basically keep food covered after washing, and check plant pots on kitchen windowsill. Buy a door fly screen, you can get them for windows too I believe.
Use fly papers and outside the kitchen, a can of fly spray. I don't use it in the kitchen as I don't want that stuff settling on plates etc or food prep surfaces. You realy don't need to be breathing or ingesting fly spray!