【问题标题】:Is there a shortcut to run `flutter pub get` in Android Studio?是否有在 Android Studio 中运行“flutter pub get”的快捷方式?
【发布时间】:2022-01-14 20:55:09
【问题描述】:

有时当我切换分支时,IDE 会在 Dart 文件中显示错误。在 Android 或 iOS 开发中,我会进行清理和重建。或“gradle sync”。

我发现最接近的等价物是flutter doctorflutter pub get。在我上面提到的问题中,flutter pub get 修复它并快速运行。

是否有快捷方式或按钮可以从 Android Studio 快速运行它?我知道我可以在终端中输入它,但我希望有快捷方式。

【问题讨论】:

    标签: git flutter android-studio dart flutter-dependencies


    【解决方案1】:

    我找到了一些选择!可悲的是没有按钮,我还没有找到添加按钮的插件。但我找到了下一个最接近的东西。

    选项 1(动作搜索)

    1. 运行“Search Everywhere”命令(搜索动作)。对我来说,这是双班制
    2. 输入“pub get”并按回车

    这将运行Tools -> Flutter -> Flutter Pub Get中的命令

    选项 2(快捷方式)

    使用上面的相同选项,您可以使用键盘映射。

    1. 转到设置 (cmd + ,) -> 键盘映射
    2. 搜索“pub get”
    3. 将它绑定到任何你想要的(我做了ctrl + b

    选项 3(颤振增强)

    使用 Android Studio 插件Flutter Enhancement Suite

    1. 下载 Flutter 增强套件
    2. 右键单击lib目录并选择“Run Pub Get”

    【讨论】:

      猜你喜欢
      • 2020-08-13
      • 2020-03-24
      • 2019-12-25
      • 1970-01-01
      • 2014-07-11
      • 2011-06-23
      • 2018-10-05
      • 2016-03-28
      • 1970-01-01
      相关资源
      最近更新 更多