You definitely need to see a doctor
about this issue. Flashing lights in the eye can be a sign of several medical problems, some of which can be very serious. I would recommend that you see both your primary care doctor
and also an eye doctor
Your primary care doctor will evaluate you for underlying over all medical problems which could be causing your symptoms. Principally, these will include migraine headaches, which can often manifest as flashing lights in the eye, and any signs of a more serious neurological problem.
Your eye doctor, on the other hand, will be able to evaluate you for any problems related specifically to the eye. These could include elevated pressure inside the chambers of the eye, known as glaucoma, as well as any evidence of tears in or damage to the retina. In order to rule out all of these possibilities, your eye doctor will probably want to perform a full dilated eye exam, which involves putting some drops in your eye to dilate the pupil so that they can get a good look all the way to the back of your eye.
Start by making these two doctor appointments as soon as possible.