What do you mean by "flicker"? Is it going off and on real fast or are you seeing distortions in the image? (Can you take a pic or video?)
Also how are you charging? What kind of outlet are you using / amps is it drawing, is it on a dedicated breaker, etc.
I'm not recommending this as a full solution, cuz there may be bigger issues at play, but putting your computer on an uninterruptible power supply (UPS) may help stabilize its power and prevent the flickering.