My dryer sticks out from the wall a good 5” because of the vent and gas line. I know how to fix then vent issue but he gas line is a different story. Is there some kind of recessed gas line box I could use or any ideas? Thanks for any help.
Based on the picture seems the biggest issue is the vent, i have the same issue about sticking out, so just yesterday i bought a low profile adjustable vent that is thin to allow me to get the dryer within 2 or 3 inches from the wall.. As for the gas line, i think since the valve and connection to your dryer are offset, once you get the vent taken care of you will get alot closer.
But if you are truely looking to get the gas valve closer, you will need to get the gas turned off first in order to undo the existing pipe and valve and replace with a shorter pipe. In the wall should be a 90 degree elbow, that has that nipple screwed into it and then the valve. You would need to replace the nipple with a shorter one and if you are really looking to get it flush with the wall, you need to consider how you would tighten the gas line once its receesed into the wall.. makes it alot easier to tighten the gas line onto the pipe when you can and should hold the vavle with a wrench and tighten the line with another wrench so you dont damage anything.. If you have the room you could alway look into something like this:
Hope this helps
Also this is the vent i bought to help with my install