A phase field model is developed to study the flexoelectricity in nanoscale solid dielectrics, which exhibit both structural and elastic inhomogeneity. The model is established for an elastic homogeneous system by taking into consideration all the important non-local interactions, such as electrostatic, elastic, polarization gradient, as well as flexoelectric terms. The model is then extended to simulate a two-phase system with strong elastic inhomogeneity. Both the microscopic domain structures and the macroscopic effective piezoelectricity are thoroughly studied using the proposed model. The results obtained show that the largest flexoelectric induced polarization exists at the interface between the matrix and the inclusion. The effective piezoelectricity is greatly influenced by the inclusion size, volume fraction, elastic stiffness, and the applied stress. The established model in the present study can provide a fundamental framework for computational study of flexoelectricity in nanoscale solid dielectrics, since various boundary conditions can be easily incorporated into the phase field model.