Feeling Lost And Devestated Need Advice Please!

I currently found out my boyfriend of 7 months has been hiding a pain pill addiction from me. He lived with me and I had no idea he has this as a problem. I had some things going on and decided I needed to move to another province and he had agreed to come with me after going back and forth on the idea. Then last week he and I had an argument and all of a sudden he said he couldn't come and moved out that night. He just took off and that was that. We were very very close and talked about marriage and kids and the future. He just told me yesterday that he left because he couldn't hide it from me anymore and knew if he told me I would just end the relationship anyway as I am very against drugs.... he says he has been trying to detox for the past few days at his friends house and he left because he knew he was toxic for me and my daughter. I appreciate that he has thought of how toxic this is for me and my daughter but now I feel helpless because he has pushed me away and barely talks to me. He says he plans to move out of province to his family's house and try to get clean off these and that he can't be with me. I'm heartbroken because I didn't see this comming! I don't understand why he is pushing me so far away when he balled his eyes out for days because he was leaving and we were over? I don't know how to support him or how to accept that the guy I love and thought I would have a family with one day is gone ? Anyone with some advice, insight or suggestions please help! I feel like nothing I say or do is good enough !
Anyone!? I need advice? Why would this person who loves me push me away and barely talk to me? It's night and day. Different person overnight! If I txt he will respond with just a few words or say he is going to go nap, or shower or make an excuse to stop talking to me. He never lied to me and was always honest except about this big secret he had. He was like a normal guy, didn't act like he was an addict in anyway accept now looking back I can see times he was actually detoxing rather then "not feeling well". Why would he just stop loving me and go emotionally empty? Someone please help me understand what could be going on!
he says he has been trying to detox for the past few days at his friends house and he left because he knew he was toxic for me and my daughter. I appreciate that he has thought of how toxic this is for me and my daughter but now I feel helpless because he has pushed me away and barely talks to me.

You can't make this about you. He's doing what's best for him and what he needs to do for himself right now. He's trying to get clean and he needs all his energy to focus on that. Give him the space he needs. I know it hurts but this is what he wants and needs from you right now. He need's space and he's made that clear to you. If you care for him as much as you say, then respect his wishes. Let him get his life together and maybe somewhere down the road he'll reach out to you. But for now, you've got to give him that space.

Been in both places now. Believe me- until he is able to get a handle on this, you will not have a healthy relationship anyways. Give your relationship a true shot & tell him you're giving him the space to get & stay clean. Then, you can either be there or not when he's finally ready. You never know- perhaps your life will become much happier once you get distance. But until he's done what he needs to do- it will NEVER be the relationship we all want & deserve.
All the best!!!!