This is what I want.
int _foo = 42;
int get foo => _foo;
But when I format the code using dartfmt, it changes to
int _foo = 42;
int get foo => _foo;
How can I prevent this behavior?
This is what I want.
int _foo = 42;
int get foo => _foo;
But when I format the code using dartfmt, it changes to
int _foo = 42;
int get foo => _foo;
How can I prevent this behavior?
Copyright © 2021 Jogjafile Inc.
There are two types of formatting. One is regular formatting provided by the IDE, also known as
Reformat Codeand the other is provided by Flutter CLI, also known asReformat Code with Dartfmt.By default, when you press the keyboard shortcut option + command + L, it runs the former
Reformat Code(which doesn't usedartfmtto format the code).To fix this behavior, override keyboard shortcut in your IDE. Go to
and assign it the above mentioned shortcut.