Flutter错误:没有名为“ overflow”的命名参数

时间:2020-09-18 16:22:09

标签: android flutter dart flutter-packages speed-dial

我正在忙于开发一个应用程序,突然有一天,当我尝试运行该应用程序时,一切运行正常,

/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

3 个答案:

答案 0 :(得分:4)

您还应该检查库的PR;)。 This one解决了该问题。您可以检查commits并更改自己的代码。或者也许要等待几天,几小时才能完成合并。

如果确实需要,可以派生该库,但现在只需注释引用该库的代码,直到合并修订为止

答案 1 :(得分:1)

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

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

如果问题仍然存在,请尝试删除导致该问题的唯一软件包。在我的情况下,curvedNavigationBar是有问题的,我删除了程序包,然后问题解决了。

答案 2 :(得分:0)

我遇到了这种问题。更新了Flutter SDK之后,我的问题解决了。更新您的Flutter SDK,它可能会起作用。