Viewport flicker to Black

Viewport flicker to Black while moving in view port. same thing happens with camera too (5.0.1)

I have seen this problem before and in my case it was happening when i was very far away from the center and looking away from it.
To fix it you have to check “Enable Large Worlds” in World Settings:
image