We develop a model to explain the flaring activity in gamma-ray burst X-ray afterglows within the framework of slightly misaligned observers to structured jets. We suggest that flares could be the manifestation of prompt dissipation within the core of the jet, appearing to a misaligned observer in the X-ray band because of less favorable Doppler boosting. These flares appear during the afterglow phase because of core-observer light travel delays. In this picture, the prompt emission recorded by this observer comes from material along their line of sight, in the lateral structure of the jet, outside the jet's core. We start by laying down the basic analytical framework to determine the flares characteristics as a function of those of the gamma-ray pulse an aligned observer would have seen. We show that, for typical flare observing times and luminosities, there is indeed viable parameter space to explain flares in this way. We then analytically explore this model and show that it naturally produces flares with small width, a salient property of flares. We perform fits of our model to two Swift/XRT flares representing two different types of morphology, to show that our model can capture both. The ejection time of the core jet material responsible of the flare is a critical parameter. While it always remains small compared to the observed time of the flare, confirming that our model does not require very late central engine activity, late ejection times are strongly favored, sometimes larger than the observed duration of the parent GRB's prompt emission as measured by 𝑇 90 .