Skip to content

调试报错 #4

Description

@309791679

使用flutter版本2.5.1\2.2.0
使用版本昨晚7点最新代码
报错原因 找不到 ancestorStateOfType这个方法

详细报错日志
../lib/src/scroll_view_listener.dart:19:41: Error: Method not found: 'TypeMatcher'.
return (context.ancestorStateOfType(TypeMatcher()) as ScrollViewListenerState)?.broadCaseStream;
^^^^^^^^^^^
../lib/src/scroll_view_listener.dart:19:21: Error: The method 'ancestorStateOfType' isn't defined for the class 'BuildContext'.

  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/H:/%E7%BC%96%E7%A8%8B%E7%B1%BB/%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%8C%85/flutter_2.5.1/flutter/packages/flutter/lib/src/widgets/framework.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'ancestorStateOfType'.
    return (context.ancestorStateOfType(TypeMatcher()) as ScrollViewListenerState)?.broadCaseStream;
    ^^^^^^^^^^^^^^^^^^^
    ../lib/src/sliver_scroll_listener.dart:60:47: Error: The method 'ancestorRenderObjectOfType' isn't defined for the class 'BuildContext'.
  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/H:/%E7%BC%96%E7%A8%8B%E7%B1%BB/%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%8C%85/flutter_2.5.1/flutter/packages/flutter/lib/src/widgets/framework.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'ancestorRenderObjectOfType'.
    RenderSliver renderSliver = context.ancestorRenderObjectOfType(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../lib/src/sliver_scroll_listener.dart:61:15: Error: The method 'TypeMatcher' isn't defined for the class '_State'.
  • '_State' is from 'package:flutter_sliver_tracker/src/sliver_scroll_listener.dart' ('../lib/src/sliver_scroll_listener.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'TypeMatcher'.
    TypeMatcher());
    ^^^^^^^^^^^
    ../lib/src/sliver_scroll_listener.dart:74:47: Error: The method 'ancestorRenderObjectOfType' isn't defined for the class 'BuildContext'.
  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/H:/%E7%BC%96%E7%A8%8B%E7%B1%BB/%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%8C%85/flutter_2.5.1/flutter/packages/flutter/lib/src/widgets/framework.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'ancestorRenderObjectOfType'.
    RenderSliver renderSliver = context.ancestorRenderObjectOfType(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../lib/src/sliver_scroll_listener.dart:75:15: Error: The method 'TypeMatcher' isn't defined for the class '_State'.
  • '_State' is from 'package:flutter_sliver_tracker/src/sliver_scroll_listener.dart' ('../lib/src/sliver_scroll_listener.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'TypeMatcher'.
    TypeMatcher());
    ^^^^^^^^^^^
    ../lib/src/sliver_scroll_listener.dart:84:47: Error: The method 'ancestorRenderObjectOfType' isn't defined for the class 'BuildContext'.
  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/H:/%E7%BC%96%E7%A8%8B%E7%B1%BB/%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%8C%85/flutter_2.5.1/flutter/packages/flutter/lib/src/widgets/framework.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'ancestorRenderObjectOfType'.
    RenderSliver renderSliver = context.ancestorRenderObjectOfType(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../lib/src/sliver_scroll_listener.dart:85:15: Error: The method 'TypeMatcher' isn't defined for the class '_State'.
  • '_State' is from 'package:flutter_sliver_tracker/src/sliver_scroll_listener.dart' ('../lib/src/sliver_scroll_listener.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'TypeMatcher'.
    TypeMatcher());
    ^^^^^^^^^^^
    ../lib/src/sliver_multi_box_scroll_lintener.dart:35:49: Error: Method not found: 'TypeMatcher'.
    _State state = (context.ancestorStateOfType(TypeMatcher<_State>()) as _State);
    ^^^^^^^^^^^
    ../lib/src/sliver_multi_box_scroll_lintener.dart:35:29: Error: The method 'ancestorStateOfType' isn't defined for the class 'BuildContext'.
  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/H:/%E7%BC%96%E7%A8%8B%E7%B1%BB/%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%8C%85/flutter_2.5.1/flutter/packages/flutter/lib/src/widgets/framework.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'ancestorStateOfType'.
    _State state = (context.ancestorStateOfType(TypeMatcher<_State>()) as _State);
    ^^^^^^^^^^^^^^^^^^^
    ../lib/src/scroll_item_offset_mixin.dart:23:71: Error: The method 'ancestorRenderObjectOfType' isn't defined for the class 'BuildContext'.
  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/H:/%E7%BC%96%E7%A8%8B%E7%B1%BB/%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%8C%85/flutter_2.5.1/flutter/packages/flutter/lib/src/widgets/framework.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'ancestorRenderObjectOfType'.
    RenderSliverMultiBoxAdaptor renderSliverMultiBoxAdaptor = context.ancestorRenderObjectOfType(TypeMatcher());
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../lib/src/scroll_item_offset_mixin.dart:23:98: Error: The method 'TypeMatcher' isn't defined for the class 'ScrollItemOffsetMixin'.
  • 'ScrollItemOffsetMixin' is from 'package:flutter_sliver_tracker/src/scroll_item_offset_mixin.dart' ('../lib/src/scroll_item_offset_mixin.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'TypeMatcher'.
    RenderSliverMultiBoxAdaptor renderSliverMultiBoxAdaptor = context.ancestorRenderObjectOfType(TypeMatcher());

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions