Analytical Afterglow Light Curves of Gamma-ray Bursts: the Case of a Flat Electron Spectrum