We investigate Anderson localization on various 1D structures having flat bands. The main focus is on the scaling laws obeyed by the localization length at weak disorder in the vicinity of flat-band energies. A careful distinction is made between situations where the scaling functions are universal (i.e., depend on the disorder distribution only through its width) and where they keep depending on the full shape of the disorder distribution, even in the weak-disorder scaling regime. Three examples are analyzed in detail. On the stub chain, one central flat band is isolated from two lateral dispersive ones. The localization length remains microscopic at weak disorder and exhibits disorder-specific features. On the pyrochlore ladder, the two flat bands are tangent to a dispersive one. The localization length diverges with exponent 1/2 and a non-universal scaling law, whose dependence on the disorder distribution is predicted analytically. On the diamond chain, a central flat band intersects two symmetric dispersive ones. The localization length exhibits two successive scaling regimes, diverging first with exponent 4/3 and a universal law, and then (i.e., further away from the pristine flat band) with exponent 1 and a non-universal law. Both scaling functions are also derived by analytical means.