I have heard of this before occurring in iPhone 5s and 6’s. Unfortunately I don’t have a quick fix. I believe this is due to a bad or missing coil on the back-light circuit which is an on-board component of the main logic board. The only work around I am aware of that you can do yourself would be setting the brightness at 50% or whatever level stops the flickering on your device and turn off the Auto Brightness feature so you can bare with it.
You could reach out to repair specialists such as iPadRehab.com and see if they would fix it for you. It could be an inexpensive fix as long as there was not water damage and there has not been a previous technician inside the device.