In using the inverse square law here, you assume that the radiation from the star spreads out evenly in all directions and no radiation is absorbed in space. More test answers on https://studyhippo.com/aqa-a-level-astrophysics-chapter-2/