The electric flux over closed surface can be calculated if
Only the location of each point charge inside the surface is specified.
The variation of electric field vector at different points on the closed surface is specified.
The total charge outside the surface is specified.
The magnitude of the electric field is known every where on the surface.`
Flux over a closed surface is given by ϕE=E→.dA→ So variation of E→ must be specified.