Buttons are one of the most important types of interactions in apps. It's almost impossible to imagine an app that doesn't have a button in some form or another. They are extremely flexible: you can customize their shape, color, and touch effects; provide haptic feedback; and more. But regardless of the styling, all buttons serve the same purpose. A button is a widget that users can touch (or press, or click). When their finger lifts off the button, they expect the button to react. Over the years, we have interacted with so many buttons that we don't even think about this interaction anymore – it has become obvious.
In this recipe, you are going to add two buttons to the stopwatch app: one to start the counter and another to stop it. You going are going to use two different styles of buttons – ElevatedButton and TextButton – for these different functions, but note that even though they look different...