Home > Software design >  Is there a shortcut to run `flutter pub get` in Android Studio?
Is there a shortcut to run `flutter pub get` in Android Studio?

Time:01-17

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)

  1. Run the "Search Everywhere" command (which searches actions). For me, it is double shift.
  2. 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.

  1. Go to Settings (cmd ,) -> Keymap
  2. Search for "pub get"
  3. Bind it to whatever you want (I did ctrl b)

Option 3 (Flutter Enhancement)

Using the Android Studio plugin Flutter Enhancement Suite.

  1. Download Flutter Enhancement Suite
  2. Right-click the lib directory and select "Run Pub Get"
  •  Tags:  
  • Related