-1

For example, if you have a bunch of custom buttons, do you make a class (for example, CustomButtons) and then have static functions that return different buttons? Or do you make dart files and make independent widget constants?

There are different ways to do custom widgets... like another one is having const widget themes and then creating widgets on the spot and using those themes.

What is the best practice?

NNN
  • 1
  • 3
  • you can use every one that you find easy for yourself – Mohammad_Asef Feb 01 '21 at 06:57
  • Possible duplicate: Widget classes vs functions returing widgets https://stackoverflow.com/questions/53234825/what-is-the-difference-between-functions-and-classes-to-create-reusable-widgets – Sisir Feb 01 '21 at 07:16

1 Answers1

0

It depends If you have a complex widget then you must create a separate file and create your custom widget there. But if your widget is small then use static function etc.

Junaid Hassan Final
  • 307
  • 1
  • 2
  • 11