Closed longtimedeveloper closed 3 years ago
Hi @longtimedeveloper - ~I'm trying to understand what you are asking for... Do you want isNotValid
to appear before isValid
?~
~(If I'm wrong, maybe you could provide a "Would Like It To Be Like This:" section.)~
EDIT: Oh, I think I get it... you want all the "other" methods to be sorted... OK, my comments below still apply, I think.
Note that the original design (in the README) states this:
public-other-methods
in configuration)I worked on a very large Flutter project and we decided that the stylizer should not mess around with the ordering of all the "other" methods that don't fall into another category.
I'll leave this topic open in case there is demand for it, but I'm thinking that this might be much more challenging and bug-ridden to implement, so I'm leaning toward not implementing this.
@gmlewis I updated the original question and handled the concern about sorting alphabetically with mature code.
There is an additional ask to group getters together.
Make sense? Thank you!
OK, gotcha. Thank you for the "Desired" section, @longtimedeveloper - that helps a lot.
So if we made this an option (by default it would be disabled), then would could consider this an "experimental" feature and see if I can get it to work. :-)
... and an additional option to group getters together.
@gmlewis thank you so very much.
I did check the code and read the below. From a quick look, it appears already have a sort function and it sorts by name. Is this not working or possibly turned off?
case 'public-static-variables': {
dc.staticVariables.sort(sortFunc)
addEntities(dc.staticVariables, false)
break
}
Is this not working or possibly turned off?
That's specifically for static variables. Note that each section (except for "other methods") should already be getting sorted... so this issue (I believe) is specifically for what this plugin calls "other methods".
@gmlewis Ah... Yes, that is the only group not sorted. I hope this will be easy, thank you again!!!
Hi @longtimedeveloper - this issue has been addressed in release: https://github.com/gmlewis/flutter-stylizer/releases/tag/v0.0.19
Please read either the CHANGELOG.md
or the README.md
to discover the two new configuration flags needed to enable the new features, and let me know if you find any bugs. Thanks!
@gmlewis OUTSTANDING, thank you very much. Great readme.md too!!
Hi,
Is it possible to enable sorting each block alphabetically?
Version: v0.0.17
You can see the below before and after. The after-class groups are not sorted. Any way to do this?
Before
After
Desired
Having getters group together I think is very important.
Within each group, sort alphabetically as above.
I totally understand some developers pushing back on alphabetical sorting because of the hubbub that would be created by changing the file from a git comparison or merge perspective.
To honor that concern, recommend adding an additional method that does sort alphabetically.
Thank you very much for your time and consideration,
Karl