There has been a built-in flashlight on iPhones and iPod touches ever since the release of the Control Center in iOS 7, but it has stayed exactly the same since then. Now, in iOS 10, you can actually adjust the brightness from the toggle if you have 3D Touch.
First, swipe up the Control Center from any screen, then just force-press the flashlight icon until a menu pops up allowing you to choose between Bright Intensity, Medium Intensity, and Low Intensity. The difference between them is drastic, covering all the bases.
You do need a device with 3D Touch to adjust flashlight brightness right now, so the 6s and new iPhone 7 models are the only devices it'll work with right now. Apple was once rumored to be creating a non-3D Touch way for iPhone 6 users and below to change flashlight brightness, but it hasn't yet materialized, and likely never will.