We obtain a phase diagram of the spin imbalanced Hubbard model on the Lieb lattice, which is known to feature a flat band in its single-particle spectrum. Using the BCS mean-field theory for multiband systems, we find a variety of superfluid phases with imbalance. In particular, we find four different types FFLO phases, i.e. superfluid phases with periodic spatial modulation. They differ by the magnitude and direction of the centre-of-mass momentum of Cooper pairs. We also see a large region of stable Sarma phase, where the density imbalance is associated with zero Cooper pair momentum. In the mechanism responsible for the formation of those phases, the crucial role is played by the flat band, wherein particles can readjust their density at zero energy cost. The multiorbital structure of the unit cell is found to stabilize the Sarma phase by allowing for a modulation of the order parameter within a unit cell. We also study the effect of finite temperature and a lattice with staggered hopping parameters on the behaviour of these phases.