Right now, the only known way to create gravity is with mass. To create Earth-like gravity, you would need a ball of mass as large as the Earth. The Earth doesn’t have the highest possible density, a neutron star or even a small black hole could create Earth-like gravity using a sphere of mass that is much smaller in diameter. Using the density of a neutron star, the sphere could be as small as 0.05 cubic kilometers. With a sphere that small, the spherical space station’s floor would have a noticeable curvature. You could do a space station but a spacecraft is absurd, there isn’t enough propellent in the entire star system to move something that heavy into a new orbit.
Scientists recently proved the existence of the Higgs Boson, the sub-atomic particle that gives other particles their mass. Right now, there is not a single theory that says it could be possible to create gravity in only 1 dimension. To imitate the majority of science fiction universes, you would need to be able to create artificial gravity without making your ship so massive that it’s impossible to move and you would need a way to create gravity in only one direction. Most worldbuilders use that concept because it’s the most practical for set design not because it’s scientifically plausible.
In my universe, the space stations spin to create artificial gravity, which is known as the centrifugal force. If the ring is large enough, the curvature of the floor isn’t a problem. In the picture above, you can see how the floor curves up on the horizon. It has two rings with a radius of 2.8 kilometers, spinning in opposite directions and orbits the Sun between Earth and Venus. One side is always facing the Sun and converts solar energy into electricity. There is also enough room to grow enough food in hydroponic farms to support the population. The following is a spreadsheet I created for calculating the specifications of space stations.