  The methods of dynamical systems have found wide applications in cosmology,
with focus either upon inflation or upon the passage into dark energy era. In
this paper, we endeavor to capture the whole history of the universe into a
dynamical system by considering generic scalar tensor gravity with radiation
and dust matter fluids in flat Friedmann-Lemaitre-Robertson-Walker spacetime.
We construct the dynamical variables in such a way that the main stages of the
cosmic evolution, viz. inflation, radiation domination, matter domination, and
dark energy domination can be represented by the respective fixed points in the
phase space. As the evolution of solutions is ruled by the sequence of these
fixed points with appropriate properties, we can determine the conditions that
the scalar potential and nonminimal coupling must satisfy for the model to
deliver viable cosmic history in a generic manner. We illustrate the
construction by a scalar field with quartic potential, with and without
quadratic nonminimal coupling to curvature.
