Euclid will survey galaxies in a cosmological volume of unprecedented size, providing observations of more than a billion objects distributed over a third of the full sky. Approximately 20 million of these galaxies will have spectroscopy available, allowing us to map the three-dimensional large-scale structure of the Universe in great detail. This paper investigates prospects for the detection of cosmic voids therein, and the unique benefit they provide for cosmology. In particular, we study the imprints of dynamic and geometric distortions of average void shapes and their constraining power on the growth of structure and cosmological distance ratios. To this end, we make use of the Flagship mock catalog, a state-of-the-art simulation of the data expected to be observed with Euclid. We arrange the data into four adjacent redshift bins, each of which contains about 11000 voids, and estimate the void-galaxy cross-correlation function in every bin. Fitting a linear-theory model to the data, we obtain constraints on $f/b$ and $D_M H$, where $f$ is the linear growth rate of density fluctuations, $b$ the galaxy bias, $D_M$ the comoving angular diameter distance, and $H$ the Hubble rate. In addition, we marginalize over two nuisance parameters included in our model to account for unknown systematic effects in the analysis. With this approach Euclid will be able to reach a relative precision of about 4% on measurements of $f/b$ and 0.5% on $D_M H$ in each redshift bin. Better modeling or calibration of the nuisance parameters may further increase this precision to 1% and 0.4%, respectively. Our results show that the exploitation of cosmic voids in Euclid will provide competitive constraints on cosmology even as a stand-alone probe. For example, the equation-of-state parameter $w$ for dark energy will be measured with a precision of about 10%, consistent with earlier more approximate forecasts.