【问题标题】:chewie and chewie_audio packages are showing error in Flutter咀嚼和咀嚼音频包在颤振中显示错误
【发布时间】:2021-06-08 06:28:54
【问题描述】:

我正在设置颤振项目,但每次都出现以下错误:

1 warning generated.
    ../flutter/.pub-cache/hosted/pub.dartlang.org/chewie-0.9.10/lib/src/chewie_player.dart:83:7: Error: No named parameter with the name 'resizeToAvoidBottomPadding'.
          resizeToAvoidBottomPadding: false,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../flutter/packages/flutter/lib/src/material/scaffold.dart:1451:9: Context: Found this candidate, but the arguments don't match.
      const Scaffold({
            ^^^^^^^^
    ../flutter/.pub-cache/hosted/pub.dartlang.org/chewie-0.9.10/lib/src/chewie_player.dart:276:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
     - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../flutter/packages/flutter/lib/src/widgets/framework.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
            context.inheritFromWidgetOfExactType(_ChewieControllerProvider)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../flutter/.pub-cache/hosted/pub.dartlang.org/chewie_audio-1.0.0+1/lib/src/chewie_player.dart:101:51: Error: Too many positional arguments: 0 allowed, but 1 found.
    Try removing the extra positional arguments.
            context.dependOnInheritedWidgetOfExactType(_ChewieAudioControllerProvider)
                                                      ^

    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 8 Plus.

我已经尝试过稳定渠道和测试渠道。

chewie 仅显示在 pubsec.lock 文件中。如果有人可以提供建议,请告诉我。

【问题讨论】:

    标签: flutter flutter-dependencies


    【解决方案1】:

    首先确保您在 pubspec.yaml 中保存了之前的更改,然后再保存 尝试运行:

    1. 颤振酒吧获取
    2. 扑干净
    3. 颤动运行

    【讨论】:

    • 我这样做了很多次,但它不起作用。
    • 你能提供你的文件的完整代码吗?
    • 这是旧项目,我只是在我的系统上设置,所以我不知道它是怎么来的。
    • 软件包可能已经过时了,请务必查看 www.pub.dev 并搜索您的软件包,版本可能已过时
    • 更新了所有的包,但仍然遇到同样的问题。
    猜你喜欢
    • 1970-01-01
    • 2021-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多