rrousselGit / functional_widget

A code generator to write widgets as function without loosing the benefits of classes.
596 stars 46 forks source link

Allow SingleChildStatelessWidget generation (@nwidget) #76

Closed PavelPZ closed 3 years ago

PavelPZ commented 3 years ago

I like both functional_widget and nested packages:

@nwidget
Widget w1() => child; 

@nwidget
Widget w2() => child;

@swidget
Widget wBoth() => Nested(
  children: [
    W1(),
    W2(),
  ],
  child: Text('Great!'),
)
rrousselGit commented 3 years ago

I don't mind, but what is the use-case?

rrousselGit commented 3 years ago

Nested widgets are not very performant so it really depends on what you want to do with them.

If your goal is you make UI elements (which is the primary use-case of functional_widget), nested is a bad idea.

PavelPZ commented 3 years ago

performance is important, closing...