flutter 报错 找不到方法

Xcode's output:
↳
    ../../flutter/.pub-cache/hosted/pub.dartlang.org/extended_tabs-3.0.3/lib/src/tab_view.dart:320:20: Error: The method 'disallowIndicator' isn't defined for the class 'OverscrollIndicatorNotification'.
     - 'OverscrollIndicatorNotification' is from 'package:flutter/src/widgets/overscroll_indicator.dart' ('../../flutter/packages/flutter/lib/src/widgets/overscroll_indicator.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'disallowIndicator'.
          notification.disallowIndicator();
                       ^^^^^^^^^^^^^^^^^
    Failed to package /Users/apple/MyFlutterPod/bl_flutter_module.
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete

Could not build the application for the simulator.
Error launching application on iPhone 12 Pro.

flutter 一直报这个错误,不知道为啥

.pubspec.yaml 文件 依赖    extended_tabs : any

一开始以为是缓存问题,因为我切换了分支 然后 flutterflutter pub get 无效 删除了.lock 再pub 也是无效
然后 继续删除 三方库的换粗 flutter flutter pub cache clean 然后 flutterflutter pub get 还是无效
网上也没搜索到 然后到github上看flutter 源码 有那个方法 disallowIndicator 而我的没有 我就手动添加了 然后不报错了
最后才发现实 因为 依赖的 any 它给出最适合的版本是 3.0.3 但是里面调用的方法 我的flutter 里面没有这个
后来我写死 版本号 extended_tabs : 2.3.0
搞定了 好气啊

你可能感兴趣的:(flutter 报错 找不到方法)