This paper proves universality of the distribution of the smallest and largest gaps between eigenvalues of generalized Wigner matrices, under some smoothness assumption for the density of the entries. The proof relies on the Erd{H o}s-Schlein-Yau dynamic approach. We exhibit a new observable that satisfies a stochastic advection equation and reduces local relaxation of the Dyson Brownian motion to a maximum principle. This observable also provides a simple and unified proof of universality in the bulk and at the edge, which is quantitative. To illustrate this, we give the first explicit rate of convergence to the Tracy-Widom distribution for generalized Wigner matrices.