4 & a half year relationship

I’m 18, me and this boy started dating In 2015. the last year of middle school. and we lasted through high school together. We did everything together. he was my best friend. And I only loved him more everyday. it was the best thing that ever happened to me, and still is. but recently things started getting ugly between us. and he slowly started showing me less of everything when we were on bad terms. he had ditched me for his friends one time & we argued & the argument went onto the next morning/ day. turns out , he was texting this girl he goes to college with. making plans with her while being with me. When I needed him the most. (And no I was never controlling of him. I don’t care if he talks to girls) but this girl actually tried getting at him asked him if he had a gf & all that. she started to flirt with him & I didn’t know about it because I guess he was flirting back. (Also In those texts it was very flirty) I found out from her that they were ever messaging. and it hurt more not hearing it from him. And it also made me feel/ look dumb because I found out 2 weeks after. turns out he just wasn’t as loyal as I thought he was.. the whole thing with the girl got worse. She started to talk crap About me only because me and him continued to try and work things out. and I don’t even know this girl? I only seen her in pictures. He had confronted her & told her to stop bringing me into it because it was his fault not mine. but she continued to say things about me anyway. and so me & him broke up, we are still broken up. I have trust issues. he took me for granted. he never realized what he had in front of him. and he regrets it everyday because our relationship between is not the same. he had said he only flirted back because he liked the attention & never got it that type of attention that made him feel cute about himself because I guess he’s always been insecure which makes sense to why he was up my ass about guys . so obviously that hurts & makes me feel like all the times I’ve hyped him up never meant anything. I always tried making him feel like the only guy in my world. And now it feels like it was never enough. so that girl is happy she broke us up. Because that’s what she wanted. But I don’t know what to do myself. he says he loves me & wants to spend the rest of my life with me & no one else. he said he’s trying to change for me but I’ve heard that one many many times lol. he’s definitely been showing me he cares about me ever since that whole thing happened. he does anything to make me happy. Will even let me listen to Justin Bieber in the car (which he hates) but only to see a smile on my face. gets me flowers & had been writing me cute paragraphs every morning last week. But this isn’t the first time he’s made A mistake. I’ve given him chances before. and I would always end up hurt in the end. this mistake was just the one that really broke us apart you know. I know he’s trying to show me different but it’s hard & I don’t know what to do. I love him. But everything is always in the back of my head. although every time I have anxiety attacks he is there to calm me down & make me feel better. I don’t wanna lose him so I thought to keep trying to see how things go this time. But am I stupid for even doing it ? what would any of you do in this situation?