Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow generated files and classes to follow standard Dart conventions #109

Open
esDotDev opened this issue Apr 21, 2021 · 1 comment
Open
Labels
enhancement New feature or request
Milestone

Comments

@esDotDev
Copy link

Convention in dart is that classes are PascalCase (new MyFoo()) and their corresponding file is snake_case (my_foo.dart), currently it's not possible to do with with the plugin.

It would be nice if there as some method to enable this, maybe a checkbox "Save class files as snake case"?

@esDotDev esDotDev added the enhancement New feature or request label Apr 21, 2021
@esDotDev esDotDev changed the title Allow generated files and glasses to follow standard Dart conventions Allow generated files and classes to follow standard Dart conventions Apr 21, 2021
@gskinner
Copy link
Collaborator

Added initial support for this in f6ac07b

Needs a bit more testing, but it should be fairly robust:
input --> class name --> file name
"my class" --> MyClass --> my_class.dart
"UITester" --> UITester --> ui_tester.dart
"my-view!" --> MyView --> my_view.dart

It's enabled via a new "Normalize Names" setting, which will default to false for previously opened files, and true for new files.

@gskinner gskinner added this to the v3.0.0 milestone Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants