Flies existed long before flowering plants
The earliest known true flies lived about 240 million years ago, roughly 100 million years before flowering plants appeared. Their ancestors could not have relied on flower nectar. One proposal is that they fed on honeydew from sap-sucking insects, which fits modern flies’ attraction to shiny droplets and mouthparts suited to lapping.