错误:位置参数太多:允许1个,但找到2个.请尝试删除多余的位置参数.super.addToScene(生成器,layer



我从2.5升级到flutter 2.8后出现此错误,运行flutter clean,但无法解决
..//flutter/.pub-cache/hoster/pub.dartlang.org/visibility_detector-0.2.0/lib/src/visibiliity_detector_layer.dart:276:21:错误:位置参数太多:允许1个,但找到2个。请尝试删除多余的位置参数。super.addToScene(生成器,layerOffset(;颤振刮刀

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.5.2 20G95 darwin-arm, locale en-KE)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 13.2)
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is   different from the one
being used to invoke it.
This can usually be fixed by re-installing CocoaPods.
To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for
instructions.
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google
Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio
✗ Unable to find bundled Java version.
[✓] IntelliJ IDEA Community Edition (version 2021.3)
[✓] VS Code (version 1.63.0)
[✓] Connected device (1 available)
! Doctor found issues in 3 categories.

颤振型

Flutter 2.8.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 77d935af4d (2 days ago) • 2021-12-16 08:37:33 -0800
Engine • revision 890a5fca2e
Tools • Dart 2.15.1

在升级之前,代码在2.5上运行得很好

使用可见性检测器0.2.2。

  1. 从flutter安装路径打开以下文件。flutter/.pub-cache/hosts/pub.dartlang.org/firexcode-1.0.8/lib/src/Modules/visibility_detector/visibiliity_detector_layer.dart

  2. 第276行更新代码部分

来自

super.addToScene(builder, layerOffset);

super.addToScene(builder/*, layerOffset*/);
  1. 然后重新构建,它就会工作

最新更新