Donaldson--Thomas invariants of quivers with potentials from the flow tree flormula