  We propose a platform for flat Chern band by subjecting two-dimensional Dirac
materials -- such as graphene and topological insulator thin films -- to a
periodic magnetic field, which can be created by the vortex lattice of a
type-II superconductor. As a generalization of the $n=0$ Landau level, the flat
band of Dirac fermion under a nonuniform magnetic field remains at zero energy,
exactly dispersionless and topologically protected, while its local density of
states is spatially modulated due to the magnetic field variation. In the
presence of short-range repulsion, we find fractional Chern insulators emerge
at filling factors $\nu=1/m$, whose ground states are generalized Laughlin
wavefunctions. We further argue that generalized Wigner crystals may emerge at
certain commensurate fillings under a highly nonuniform magnetic field in the
form of a flux line lattice.
