The local criterion for flatness goes this way:

Let $\phi : (A,m)\rightarrow (B,m')$ be a local morphism of local Noetherian rings, and $M$ a finitely generated $B$-module. If $x\in m$ is a non zero-divisor on $M$ then $M$ is flat over $A$ iff $M/xM$ is flat over $A/xA$.

One usual geometric interpretation (see for instance Eisenbud, *Commutative Algebra with a View towards Algebraic Geometry*, chapter 6.4) is:

If we have a morphism of affine varieties $X\rightarrow Y$ over $\mathbb{A}^1$ such that the maps to $\mathbb{A}^1$ are flat and dominant, for any point $p$ in $\mathbb{A}^1$ choose a point $p'$ in $Y$ above $p$ and a point $p''$ in $X$ above $p'$. If the map of fibers $X_{p}\rightarrow Y_{p}$ is flat in a neighborhood of $p''$ in $X_{p}$, then the map $X\rightarrow Y$ is also flat in a neighborhood of $p''$ in $X$.

I fail to see the obviousness of this interpretation: does this mean that if $R$ and $S$ are the respective affine rings defining the affine varieties $Y$ and $X$ over the field $k$, if $P'$ and $P''$ are the maximal ideals defining the points $p'$ and $p''$, if we have $S_{P''}$ flat over $R_{P'}$, there exist an element $f''$ of $S$ not contained in $P''$ such that $S_{f''}$ is flat above $R$?

I mean that using the local criterion for flatness I see how I can get the flatness of the rings localized at maximal ideals coming from the flatness on the fibers, but how to extend it to a neighborhood of each points ?

Edit: after re-reading the clear answer from Akhil Mathew, I cannot help but wondering if there is a way to get the geometric interpretation of Eisenbud without using the result on the open locus for flat maps which is above the level of chapter 6 of Eisenbud classical book. Can somebody enlighten me here?