yuexunshi / todo

基于玩安卓api的todo
169 stars 42 forks source link

在flutter v1.26.0 中项目运行报错 #1

Open TakahashiAiko opened 3 years ago

TakahashiAiko commented 3 years ago

/D:/Flutter/.pub-cache/hosted/pub.flutter-io.cn/pull_to_refresh-1.6.3/lib/src/smart_refresher.dart:273:21: Error: The method 'ancestorWidgetOfExactType' isn't defined for the class 'BuildContext'.

/D:/Flutter/.pub-cache/hosted/pub.flutter-io.cn/pull_to_refresh-1.6.3/lib/src/smart_refresher.dart:277:21: Error: The method 'ancestorStateOfType' isn't defined for the class 'BuildContext'.

Try correcting the name to the name of an existing method, or defining a method named 'ancestorStateOfType'. return context?.ancestorStateOfType(TypeMatcher()); ^^^^^^^^^^^^^^^^^^^ /D:/Flutter/.pub-cache/hosted/pub.flutter-io.cn/pull_to_refresh-1.6.3/lib/src/smart_refresher.dart:1003:20: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.

FAILURE: Build failed with an exception.

TakahashiAiko commented 3 years ago

https://github.com/peng8350/flutter_pulltorefresh/issues/422

cn1001wang commented 3 years ago

我也遇到相同的问题

cn1001wang commented 3 years ago

顺便问一下,

binding的作用是什么,官方文档好像没提,但是用get_cli生成会带上这个。还有就是GetMaterialApp( initialBinding: SplashBinding(), ) initialBinding是什么意思,我看AppPages里又有写binding,根下的initialBinding是起到什么作用。我点进去看他就是?.dependencies()

greyireland commented 3 years ago

替换一下包pull_to_refresh由1.6.3为1.6.4解决了问题

  pull_to_refresh: ^1.6.4
hestudy commented 3 years ago

顺便问一下,

binding的作用是什么,官方文档好像没提,但是用get_cli生成会带上这个。还有就是GetMaterialApp( initialBinding: SplashBinding(), ) initialBinding是什么意思,我看AppPages里又有写binding,根下的initialBinding是起到什么作用。我点进去看他就是?.dependencies()

耦合view与controller