-
-
Notifications
You must be signed in to change notification settings - Fork 3
Group type of variables #31
Comments
Amazing! Thanks a bunch |
No problem. Thanks for the suggestion, @Hauglid ! Version |
I tried this now, and it doesn't sort the variables. I tried with both true and false. |
Please copy/paste your config settings for this plugin here so we can figure out the problem. You need to add the new It is important that this plugin continues to behave the same way as it did previously for other people which is why we need to add new flags when new behaviors are requested. I hope that makes sense. |
Yes, I understand the need for the flags. This is the settings I have:
|
So I think I figured it out. Is the formatter only for Stateful/StatelessWidget? Edit: |
I will try to make a minimal, reproducible example later today. |
Yikes... sounds like a bug!
Fantastic, thank you! I'll work on fixing the bug when I get an example case. |
Hey @Hauglid were you able to create the example? I'm looking forward to using this feature as well 🤗 |
Hi. Sorry, not yet. Been busy at work. I will try to get it done soon. |
Here is a model class with a lot of different variables types. I couple of things I noticed is that private vars and final are sorted by name, not type and name. I would guess that this is the same for static and const? // ignore_for_file: unused_field
class User {
User({
required this.firstNameFinal,
required this.idFinal,
required this.lastNameFinal,
required this.middleNameFinal,
required this.phoneNumberFinal,
required this.usernameFinal,
required this.firstNameRegular,
required this.idRegular,
required this.lastNameRegular,
required this.usernameRegular,
});
final String firstNameFinal;
final int idFinal;
final String lastNameFinal;
final String? middleNameFinal;
final String? phoneNumberFinal;
final String usernameFinal;
String firstNameRegular;
int idRegular;
String lastNameRegular;
String usernameRegular;
int? ageOptional;
String? birthdateOptional;
String? emailOptional;
String? middleNameRegular;
String? phoneNumberRegular;
int? _agePrivate;
String? _birthdatePrivate;
String? _emailPrivate;
final String _firstNamePrivate = 'Secret';
final int _idPrivate = 0;
final String _lastNamePrivate = 'Secret';
String? _middleNamePrivate;
final String _phoneNumberPrivate = 'Secret';
final String _usernamePrivate = 'Secret';
} |
Ah! I get it now. Thank you for the example, @Hauglid ... that helps tremendously. I'll add support for the private vars as well. |
@Hauglid - please try out release |
Great work! It seems to be working as intended now 💯 |
Is your feature request related to a problem? Please describe.
Variables are grouped, but I would much more prefer to group optionals, finals, normal vars.
Describe the solution you'd like
Separate different type of variables.
Example:
How it is today:
How I would prefer it to be:
The text was updated successfully, but these errors were encountered: