  We demonstrate a generic mechanism to realize topological flat minibands by
confining massive Dirac fermions in a periodic moir\'e potential, which can be
achieved in a heterobilayer of transition metal dichalcogenides. We show that
the topological phase can be protected by the symmetry of moir\'e potential and
survive to arbitrarily large Dirac band gap. We take the MoTe$_2$/WSe$_2$
heterobilayer as an example and find that the topological phase can be driven
by a vertical electric field. By projecting the Coulomb interaction onto the
topological fat minibands, we identify a correlated Chern insulator at half
filling and a quantum valley-spin Hall insulator at full filling which explains
the topological states observed in the MoTe$_2$/WSe$_2$ in experiment. Our work
clarifies the importance of Dirac structure for the topological minibands and
unveils a general strategy to design topological moir\'e materials.
