Extending Material Components in Flutter

540

From docs

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.

That's mean that Widgets are not supposed to be extended, this is why there are no examples or tutorials how to do it.

But you can still look for source code of widgets and create one new to fit your needs

Share:
540
ciceropablo
Author by

ciceropablo

foobar

Updated on December 20, 2022

Comments

  • ciceropablo
    ciceropablo over 1 year

    I want to create a collection of custom widgets extending from Material Components. Which is a better way?