Most likely the Federation did have a flagship at all times. However, only a couple ships were actually stated to be the flagship in canon Star Trek.
The USS Enterprise-D was the Federation flagship from its commissioning in 2364 to its destruction in 2371. Other than that, the only other ship ever specifically stated to be the flagship was the alternate reality original Enterprise from the recent movie.
The Enterprise NX-01 may have also been a flagship since it was by far the most advanced Starfleet vessel of its time. I vaguely recall reading that it was mentioned as such in canon, but don't see that detail listed on Memory Alpha. So, you can take that with a grain of salt unless you can find actual proof of that somewhere. :-)
Enterprise-D was, and the Enterprise-E was the Federation's most advanced Starship at that time, but since it was the closest thing Starfleet had to a warship they might of choosen a less.. agressive ship.