rrousselGit / functional_widget

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

Add option to customize name #70

Closed triallax closed 2 years ago

triallax commented 4 years ago

Maybe something like this:

@FunctionalWidget(className: 'FooBar')
Widget foo() => Text('foo');
rrousselGit commented 4 years ago

Hi!

What's the use-case? 😄

triallax commented 4 years ago

I mainly would like this feature for acronyms at the beginning of the widget's name.

rrousselGit commented 4 years ago

I don't understand

Do you have an example?

triallax commented 4 years ago

Here's an example:

Widget ioWidget() => // Whatever;

This generates a widget with the name IoWidget. I would want the widget to have the name IOWidget. It is possible to use iOWidget as the function name, but it looks ugly.

triallax commented 4 years ago

Also, I think this would fix #42 because one can use a public widget name for a private function, but I don't like this because one will have to sync the function name and the class name.

rrousselGit commented 4 years ago

I see

Feel free to make a pull request 😄

triallax commented 4 years ago

I'll see if I can do it!

triallax commented 4 years ago

I took a stab at this and I wasn't able to do it unfortunately, and I'm a little busy. If anybody would like to fix this issue, go ahead!

triallax commented 3 years ago

In retrospect, this doesn't look that necessary to me anymore. I did say that

It is possible to use iOWidget as the function name, but it looks ugly.

but honestly, that doesn't seem like a strong enough reason to add this.