首页 > 解决方案 > 没有为“Stack”类定义 getter ClipBehavior

问题描述

我正在尝试运行包含“堆栈”的应用程序,但它给了我一个错误,即:

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.6.0/lib/src/stack.dart:43:25: Error: The getter 'ClipBehavior' isn't defined for the class 'Stack'.
 - 'Stack' is from 'package:convex_bottom_bar/src/stack.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.6.0/lib/src/stack.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'ClipBehavior'.
          clipBehavior: ClipBehavior,
                        ^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.6.0/lib/src/stack.dart:53:21: Error: The getter 'ClipBehavior' isn't defined for the class 'Stack'.
 - 'Stack' is from 'package:convex_bottom_bar/src/stack.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.6.0/lib/src/stack.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'ClipBehavior'.
      clipBehavior: ClipBehavior,
                    ^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/convex_bottom_bar-2.6.0/lib/src/stack.dart:70:25: Error: The getter 'ClipBehaviorehavior' isn't defined for the class '_RenderStack'.
 - '_RenderStack' is from 'package:convex_bottom_bar/src/stack.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/convex_botvex_bottom_bar-2.6.0/lib/src/stack.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'ClipBehavior'.
          clipBehavior: ClipBehavior,
                        ^^^^^^^^^^^^


FAILURE: Build failed with an exception.

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

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\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 25s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                        26.5s
Exception: Gradle task assembleDebug failed with exit code 1

我的颤振医生很好,没有错误,我的颤振 sdk 是最新版本。我队友的应用程序在她身上运行良好。请帮忙

标签: flutterdartgradlesdk

解决方案


这就是诀窍。谢谢

  clipBehavior: Clip.none,

推荐阅读