3

我正在开发一个颤振的应用程序,当我突然尝试运行该应用程序时,一切都运行良好,它给了我这个错误:

/C:/sdk%20Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_speed_dial-1.2.5/lib/src/speed_dial.dart:249:7: Error: No named parameter with the name 'overflow'.
      overflow: Overflow.visible,
      ^^^^^^^^

/C:/sdk%20Flutter/flutter/packages/flutter/lib/src/widgets/basic.dart:3273:3: Context: Found this candidate, but the arguments don't match.
  Stack({
  ^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'C:\sdk Flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\sdk Flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

我正在使用 flutter_speed_dial: ^1.2.5 包(https://pub.dev/packages/flutter_speed_dial),我正在查看一些论坛,但我还不能解决这个问题。

这是代码的一部分:

floatingActionButton: SpeedDial(
        
        marginRight: 18,
        marginBottom: 20,
        child: Image.asset("Imagenes/Teams/team1_logo.png"),
        closeManually: false,
        curve: Curves.bounceIn,
        overlayColor: Colors.black,
        overlayOpacity: 0.5,
        onOpen: () => print('OPENING DIAL'),
        onClose: () => print('DIAL CLOSED'),
        tooltip: 'Speed Dial',
        heroTag: 'speed-dial-hero-tag',
        backgroundColor: Colors.green,
        foregroundColor: Colors.black,
        elevation: 8.0,
        shape: CircleBorder(),
        children: [
          SpeedDialChild(
              child: FittedBox(
                  child: Image.asset(
                "Imagenes/Teams/team2_logo.png",
                width: 2,
                height: 2,
                alignment: Alignment.center,
              )),
              backgroundColor: Colors.red,
              label: 'Vikingos',
              labelStyle: TextStyle(fontSize: 18.0),
              onTap: () {
                /* // variables para mover el equipo principal al seleccionar uno del floating button
                team_wait = team_selected;
                team_selected = team_child1;
                team_child1 = team_wait;
                print(team_selected);
                print(team_child1);*/
              }),
          SpeedDialChild(
            child: FittedBox(
                child: Image.asset(
              "Imagenes/Teams/team3_logo.png",
              width: 10,
              height: 10,
              alignment: Alignment.center,
            )),
            backgroundColor: Colors.blue,
            label: 'Aguilas',
            labelStyle: TextStyle(fontSize: 18.0),
            onTap: () => print('SECOND CHILD'),
          ),
          SpeedDialChild(
            child: Image.asset("Imagenes/Teams/team4_logo.png"),
            backgroundColor: Colors.yellow[700],
            label: 'Inter',
            labelStyle: TextStyle(fontSize: 18.0),
            onTap: () => print('THIRD CHILD'),
          ),
        ],
      ),

颤振医生:

[flutter] flutter doctor -v
[√] Flutter (Channel master, 1.22.0-10.0.pre.252, on Microsoft Windows [Version 10.0.18363.1082], locale es-MX)
    • Flutter version 1.22.0-10.0.pre.252 at C:\sdk Flutter\flutter
    • Framework revision 78929661fb (67 minutes ago), 2020-09-18 08:08:30 -0700
    • Engine revision 2abe69c608
    • Dart version 2.10.0 (build 2.10.0-136.0.dev)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\msaldivar\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 44.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.49.1)
    • VS Code at C:\Users\msaldivar\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.14.1

[√] Connected device (1 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

• No issues found!
exit code 0
4

5 回答 5

4

您还应该检查图书馆的 PR ;)。这个解决了这个问题。您可以检查提交并更改您的代码。或者也许等待几天,几个小时的合并。

如果您真的需要,您可以分叉该库,但现在只需注释引用它的代码,直到修复被合并

于 2020-09-18T20:05:54.227 回答
2

此错误通常是由过时(out-version)的第三方包引起的,最简单的解决方案是:

转到puspec.yaml然后删除所有第三方软件包(记住您正在使用的软件包)运行“ flutter pub get”,然后转到终端执行“ flutter Clean”然后添加所有最新版本的软件包运行“ flutter pub get”。

如果问题仍然存在,请尝试删除唯一导致问题的包。在我的情况下,curdNavigationBar 是有问题的,我删除了包然后问题就解决了。

于 2020-10-30T14:38:22.937 回答
0

我也遇到了同样的错误。它是由于外部包而发生的(在我的情况下是“下拉字段”)。引起的错误是由于autvalidate: false,如下面的代码片段。

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/dropdownfield-1.0.3/lib/dropdownfield.dart:88:11: Error: No named parameter with the name 'autovalidate'.
     autovalidate: false,
      ^^^^^^^^^^^^
   Unhandled exception:

要解决这个问题,只需转到您正在使用的包/依赖项的文档,并注释导致错误的字段。像这样,

super(
      key: key,
     // autovalidate: false,
      initialValue: controller != null ? controller.text : (value ?? ''),
      onSaved: setter,

然后再次运行您的应用程序。我希望它能解决你的问题。如果有帮助,请采纳。

于 2021-12-31T06:38:43.770 回答
0

https://i.stack.imgur.com/oTQZI.jpg

这是一个特殊的问题。你需要做的就是升级你的flutter SDK,这样你就可以解决它。就我而言,当我更新我的 SDK 时,我无法使用第三方包 StyledText。问题已解决。

于 2021-10-29T06:23:41.190 回答
0

我遇到了这种问题。更新flutter sdk后,我的问题就解决了。更新您的颤振 sdk,它可能会起作用。

于 2020-12-16T08:14:24.517 回答