I have switched from vsCode to android studio for my flutter project as I think I feel comfortable reading the code In android studio
Though in vs code when i save the file the file gets formatted and it adds const
keyword wherever my widget needed it
PROBLEM
In android studio neither the code gets formatted nor it adds const keyword wherever its needed
Please help with the 2 problem
4
Answers
You can use macros for formatting and saving the document with just one shortcut
Record the macro
Studio/IntelliJ IDEA will show the performed actions in the status
bar.
and click OK.
BIND THE MICRO WITH SHORTCUT
In the Settings/Preferences dialog ⌘,,
select Keymap.Expand the Macros node and select the created Reformat
and Save macro.
Right-click the macro and choose Add Keyboard Shortcut in the context
menu
enter image description here
File
->Settings
->Languages & Frameworks
->Flutter
Format code on save
andOrganize imports on save
options and Apply changes.As of my knowledge we have to manually add const keyword where we want…
You can do that by running the following command: