Yes and no. The short answer is yes. The real/correct/long answer is no; here's what I mean. As others have said, when you are over weight, fat all around your pubic area and belly sort of "engulf" your dick, making it seem smaller. Less of your dick is exposed when you measure it, making it seem like your cock is pretty small on the ruler. But that is not entirely accurate either, because as you lose weight, your "true" size emerges.
So technically, your dick never gets bigger. But as you lose weight, your dick "gets" bigger as more of it becomes available and visible. I lost 125 pounds to date. Here is my dick when I first started vs now for some perspective. Mind you I am still working to lose another 50-70 pounds yet. I was very obese at the beginning of my weight loss journey. From 372 pounds to 256 pounds on a 5'5 body frame.
Starting "size": 4.5ish inches.
Current "size": 6ish inches. Just a little under truthfully.
Actual size when I push my fat pad back: 6.9 inches -- just shy of 7.
And since some will probably be wondering, My girth is about 6 inches around at the thickest point, about 5.5 inches as the thinnest.
Before weight loss:
Current after 125 pounds lost:
I have more pics of my cock in my gallery if people want to see more for whatever reason. Hope this was helpful!