Your description is typical of an ocular migaine. Migraines can have these characteristic ocular phenomena followed by a headache. Ocular migaines have the visual symptoms without the headache.
No treatment is necessary. Sometimes, these light patterns could be a sign of a retinal problem. It is recommend you get a dilated eye exam by your ophthalmologist.
If you suddenly see floaters or more flashes or veil or curtain in the periphery of your vision, then you should call your ophthalmologist promptly.
Remember to press the accept button. Best wishes to you.