We completely classify Friedmann-Lema^{i}tre-Robertson-Walker solutions with spatial curvature $K=0,pm 1$ and equation of state $p=wrho$, according to their conformal structure, singularities and trapping horizons. We do not assume any energy conditions and allow $rho < 0$, thereby going beyond the usual well-known solutions. For each spatial curvature, there is an initial spacelike big-bang singularity for $w>-1/3$ and $rho>0$, while no big-bang singularity for $w<-1$ and $rho>0$. For $K=0$ or $-1$, $-1<w<-1/3$ and $rho>0$, there is an initial null big-bang singularity. For each spatial curvature, there is a final spacelike future big-rip singularity for $w<-1$ and $rho>0$, with null geodesics being future complete for $-5/3le w<-1$ but incomplete for $w<-5/3$. For $w=-1/3$, the expansion speed is constant. For $-1<w<-1/3$ and $K=1$, the universe contracts from infinity, then bounces and expands back to infinity. For $K=0$, the past boundary consists of timelike infinity and a regular null hypersurface for $-5/3<w<-1$, while it consists of past timelike and past null infinities for $wle -5/3$. For $w<-1$ and $K=1$, the spacetime contracts from an initial spacelike past big-rip singularity, then bounces and blows up at a final spacelike future big-rip singularity. For $w<-1$ and $K=-1$, the past boundary consists of a regular null hypersurface. The trapping horizons are timelike, null and spacelike for $win (-1,1/3)$, $win {1/3, -1}$ and $win (-infty,-1)cup (1/3,infty)$, respectively. A negative energy density ($rho <0$) is possible only for $K=-1$. In this case, for $w>-1/3$, the universe contracts from infinity, then bounces and expands to infinity; for $-1<w<-1/3$, it starts from a big-bang singularity and contracts to a big-crunch singularity; for $w<-1$, it expands from a regular null hypersurface and contracts to another regular null hypersurface.
Scalar field cosmologies with a generalized harmonic potential and matter with energy density $rho_m$, pressure $p_m$, and barotropic equation of state (EoS) $p_m=(gamma-1)rho_m, ; gammain[0,2]$ in Kantowski-Sachs (KS) and closed Friedmann--Lema^itre--Robertson--Walker (FLRW) metrics are investigated. We use methods from non--linear dynamical systems theory and averaging theory considering a time--dependent perturbation function $D$. We define a regular dynamical system over a compact phase space, obtaining global results. That is, for KS metric the global late--time attractors of full and time--averaged systems are two anisotropic contracting solutions, which are non--flat locally rotationally symmetric (LRS) Kasner and Taub (flat LRS Kasner) for $0leq gamma leq 2$, and flat FLRW matter--dominated universe if $0leq gamma leq frac{2}{3}$. For closed FLRW metric late--time attractors of full and averaged systems are a flat matter--dominated FLRW universe for $0leq gamma leq frac{2}{3}$ as in KS and Einstein-de Sitter solution for $0leqgamma<1$. Therefore, time--averaged system determines future asymptotics of full system. Also, oscillations entering the system through Klein-Gordon (KG) equation can be controlled and smoothed out when $D$ goes monotonically to zero, and incidentally for the whole $D$-range for KS and for closed FLRW (if $0leq gamma< 1$) too. However, for $gammageq 1$ closed FLRW solutions of the full system depart from the solutions of the averaged system as $D$ is large. Our results are supported by numerical simulations.