-
-
Notifications
You must be signed in to change notification settings - Fork 2
Comments
Ah, that's a bit trickier, but I'll see what I can come up with. |
@gslender - please try out the latest release when you have a chance: by adding the new Thank you! |
Having issues trying to figure out where it looks for the default location of the flutter-stylizer.yaml file. I've placed it in the root folder of where I'm running the command, in the user home folder but it still complains with...
So I'm guessing it isn't reading my yaml file... of which the contents are...
|
The default location is: |
Where is $HOME ?? if that's not defined? |
What platform are you running on? |
MacOS I tried with --config and got this as the output...
|
Yikes! Back to the drawing board. :-( If you feel like making a tiny test case for me that reproduces the problem, that would be great... otherwise I'll keep poking at it. Oh, and |
Yes, $HOME is set to the same path as ~/ but it doesn't work. So there is a bug/issue with the default way it derives the path for $HOME - maybe write the "path" it is trying to use when you think it is working to show that the correct config is being used... and then maybe that might tell you what is wrong at my end. Because my $HOME is correctly set, and the config file is there, but the command isn't picking it up... at least not without me using --config |
I re-ran the command with verbose on, and it barfs on a dart file with 3 enums and 3 classes defined. Does that help give you a clue to the issue? Otherwise nothing else odd about that file. I'll see if I can declassify the contents of the dart file to share, but in the meantime, see if you can confirm that a mix of enum and classes will work. |
Please note the leading dot in
OK, thanks... I'll investigate. |
Whups, I didn't mean to close this one yet. |
I believe I found the problem. I'm working on a fix. |
Hi @gslender - please try out |
Close but no cigar! It works and orders the classes in the dart files, but it also incorrectly (in my opinion) orders classes that start with an underscore ie _MyClassState lower than all other classes... so it separates the widget class from the state class associated with that widget class. The solution would be, for correct "Flutter" class ordering, to ignore the _ as a character (ie remove it in the ordering method) and allow the order to be just based on name, and the associated class files would be kept together and with the state class being lower/after the widget class. Fix that and I think you're sorted !! |
OK, gotcha. I'll work on the next version. Thanks for the feedback! I appreciate it. |
Hi @gslender - please try out |
It works well. I would suggest you consider enums as well, but happy for you to close this enh request off as done ! Awesome tool by the way :-) |
I would be happy to look into this. If you could please send me an example input along with expected output, that would make things much easier on my end. Thanks!
Thank you! I'm glad you like it. |
handling enums as you do classes... right now enums seem to be ignored and not ordered like the classes... so either sort them with classes (together) or optionally (my preference) would be to sort them like this, all enums sorted above all classes sorted. Does it really doesn't need an example to explain it..?? just sort the enums as opposed to ignoring (or make it an option) etc. Not a big deal, but it was what I then noticed after seeing the classes all nicely sorted. |
OK, so maybe |
Do you also want the internals of the enums to be processed in addition to the classes with the same ordering as the classes? |
Maybe |
Sounds good !! 👍 |
That would definitely be good if possible! |
Hi @gslender - when you get a chance, please try out the new release: Thank you! |
Works perfectly ! |
Wondering if you can add the option of ordering/sorting class objects in files - I have got into the (bad) habit of placing several related classes inside a single dart file, but it would now be nice to see them ordered as part of the stylizing ??
The text was updated successfully, but these errors were encountered: