Sometimes when I switch branches, the IDE shows errors in Dart files. In Android or iOS dev, I'd do a clean and rebuild. Or a "gradle sync".
I've found that the closest equivalents are flutter doctor and flutter pub get. In my issue mentioned above, flutter pub get fixes it and runs quickly.
Is there a shortcut or button to quickly run this from Android Studio? I know I can type it into terminal, but would love a shortcut.
CodePudding user response:
I've found a few options! Sadly there is no button and I haven't found a plugin that adds one. But I've found the next closest thing.
Option 1 (action search)
- Run the "Search Everywhere" command (which searches actions). For me, it is double shift.
- Type "pub get" and press enter
This will run the command found in Tools -> Flutter -> Flutter Pub Get
Option 2 (shortcut)
Using the same option above, you can use a keymap.
- Go to Settings (
cmd ,) -> Keymap - Search for "pub get"
- Bind it to whatever you want (I did
ctrl b)
Option 3 (Flutter Enhancement)
Using the Android Studio plugin Flutter Enhancement Suite.
- Download Flutter Enhancement Suite
- Right-click the lib directory and select "Run Pub Get"
