xd-to-flutter-plugin icon indicating copy to clipboard operation
xd-to-flutter-plugin copied to clipboard

Allow generated files and classes to follow standard Dart conventions

Open esDotDev opened this issue 4 years ago • 1 comments

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 avatar Apr 21 '21 15:04 esDotDev

Added initial support for this in f6ac07bb5ed80d87e512685a443ab5664692bc8e

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 avatar Jul 12 '21 00:07 gskinner