difference between Reformat Code / Reformat Code with dartfmt
Solution 1
Difference between them I don't know but I know how you can add a shortcut to format code: Go to
File -> Settings -> Keymap -> Editor Action -> Reformate Code with dartfmt
and add click on it and add a shortcut
Solution 2
Both are the same essentially.
The only difference is that Reformat Code (ctrl + alt + L)
applies only to the file open in the Editor or the file selected in project files pane using Intellij
's Code formatter feature.
While Reformat Code using dartfmt
uses dartfmt
CLI command available with the flutter
SDK.
The output of both will be the same. dartfmt
allow you to format the code on directory level and from a cmd/terminal instead of an IDE.
Admin
Updated on December 16, 2022Comments
-
Admin over 1 year
In Android studio, when I open a dart file, I see two options to format the code, so my question is
What is the difference between Reformat Code / Reformat Code with dartfmt
-
Admin over 4 yearsis there output same/identical?
-
Chris almost 3 yearsThis does not answer the OP's question.