Catching Plant flies, trap, solution
We refer to them as plant flies, but they are officially called fungus gnats (Sciaridae). They look like little fruit flies/mosquitoes but smaller, so sometimes they can be mistaken for fruit flies. Characteristic, however, is the location where the little black flies can be found, namely near plants. They land in the soil surrounding the plant, so they can lay their eggs.
An adult little black fly lays up to 200 eggs in the top layer of the soil surrounding the plants. It takes these eggs 4 to 6 days to hatch. After about two weeks, the larvae of the fungus gnats transform into adult flies. After this they usually have only one week to live so they will be focusing on reproduction. They cannot fly very well and usually keep swarming around the plant pot they came from.
To make it even more complicated: little black flies are also called hummus flies or moss flies, because of the (moist) soil their larvae like to crawl around in. These larvae can be particularly harmful to young plants and plant shoots. This is because the larvae feed on decaying or soft organic material, and also eat the roots of plants. One way to prevent this is by not watering the plants from above but, for example, through a pipe in the soil. Another alternative is to use mites (Steinernema feltiae, Hypoaspis miles) as a biological pesticide against the larvae of little black flies. This mite is commercially available online.