What does it mean to have eye floaters and small lightning streak that lasts for 2 seconds?

See an eye doc. You should see a doctor who will dilate your eyes for examination of the retina. Sometimes, sudden floaters may accompany or precede the development of a tear in the retina. A retinal tear can rapidly progress to a retinal detachment. The lightning streak occurs with traction or pulling on the retina. See a retinal specialist. Avoid retinal detachment.
Flashing lights. Flashing lights in the eyes with the lights out cound be a sign of retinal issues (tears, breaks, or detachment), migraine headache related, or other issues. You need to see an eye doctor as soon as possible for an evaluation.