小编gkd*_*720的帖子

如何在 VSCode/flutter 中升级包?

我在 Flutter 项目中使用 VS Code。我刚刚编辑了 pubspec.yaml 以指向包的更高版本,它会自动运行“flutter packages get”。在我的 '/development//flutter/.pub-cache/hosted/pub.dartlang.org' 目录中,我可以看到两个版本。但是我编译的时候,好像还在用老版本。我尝试了各种方法,例如“颤振包升级”、“颤振清洁”等,但无济于事。查看 2 个包版本的源代码,我可以在较新的版本中看到我想要的更改。如何指向新包?谢谢。

更新:

这是没有更新的“以太坊”包。我曾经使用过 3.0.0 版本(方法需要 2 个参数),然后切换到 3.1.0 版本(方法需要 3 个参数)。但是使用 3 个 arg 调用编译时参数计数不正确:

client.admin.personalSendTransaction(BigInt.parse(currentAddress), currentPassword,{});

[dart] Too many positional arguments: 2 expected, but 3 found. [extra_positional_arguments_could_be_named]
Run Code Online (Sandbox Code Playgroud)

然而,将鼠标悬停在方法调用上确实显示它需要 3 个参数:

personalSendTransaction(BigInt address, String passphrase, {BigInt to, BigInt data, int gas, int gasPrice, int value, int nonce, int condition, bool conditionIsTimestamp: false}) ? Future<BigInt>
Run Code Online (Sandbox Code Playgroud)

pubspec.yaml:

    dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to …
Run Code Online (Sandbox Code Playgroud)

visual-studio-code flutter

7
推荐指数
4
解决办法
2万
查看次数

标签 统计

flutter ×1

visual-studio-code ×1