Absolutely. Flutter’s widget system was designed to be easily customizable.
Rather than having each widget provide a large number of parameters, Flutter embraces composition. Widgets are built out of smaller widgets that you can reuse and combine in novel ways to make custom widgets. For example, rather than subclassing a generic button widget, RaisedButton
combines a Material widget with a GestureDetector
widget. The Material widget provides the visual design and the GestureDetector
widget provides the interaction design.
To create a button with a custom visual design, you can combine widgets that implement your visual design with a GestureDetector
, which provides the interaction design. For example, CupertinoButton
follows this approach and combines a GestureDetector
with several other widgets that implement its visual design.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.