Answer
Planarians can detect light, but they cannot visualize images like flies can.
Work Step by Step
Flies have a much greater need to be able to visualize in order to navigate their environments, something that planarians do not necessarily need. The detection of light is sufficient for their purposes without having delicate eyes to protect.