This happened to my mac today and it's highly disappointing. My device is in perfect health and condition and all of a sudden, it just wouldn't charge.
I have the 2017 MacBook Pro, 13inches - A1708
I initially thought it was just a charger gone bad and it wouldn't cost too much to replace it.
At the service center in Mumbai, I was told that it could be a battery issue which would cost me $470USD, or it's an issue with the display which would cost me $670 to fix. I found this rather odd because my device is charging, and the screen looks perfect, no dead pixels, no lines, no changes in color....
He then tells me that I can turn it on at a 45 degree or lesser angle and it would work. I realized that it was not a screen or a battery issue and has to do with the cables. A bunch of googling got me to Flexgate.
It's terrible, I can't afford to pay and fix this. My trust in Apple has gone.