X-ray and ultraviolet (XUV) radiation from pre-main-sequence stars is a key factor to control the gas evolution in protoplanetary disks through photoevaporation and ionization. Among the XUV sources in the system, stellar flares serve as a unique emitter of hard X-ray photons (≳ 10 keV) which drive various chemical reactions in the disk. While previous observation has reported that the time- variability in stellar X-ray luminosity has a non-negligible effect on disk ionization, theoretical work has still lacked precise modeling of X-ray flares, such as the nature of individual flares and hard X-ray emission. Given the necessity to incorporate the previously overlooked factors for elucidating the role of flares in disk evolution, we develop a model of time-varying X-ray emission in pre-main-sequence stars based on theories and observations of stellar flares. This model enables us to generate X-ray light curves of flares and their spectral energy distributions, including their temporal evolution. Using our X-ray model, we also conduct the radiative transfer calculation to investigate how X-ray flares affect the disk ionization. Our findings indicate that photons with ≳ 10 keV play a critical role in disk ionization, underscoring the essential contribution of stellar flares to disk chemistry.