One of Flutter's best traits: everything is open source. The built-in widgets' source code is the best resource to learn how to build your own widgets. For example, with just 267 lines of code, the iOS button's implementation demonstrates how you can use simple animations and gestures detectors.