xuelongqy / flutter_easy_refresh

A flutter widget that provides pull-down refresh and pull-up load.
https://xuelongqy.github.io/flutter_easy_refresh/
MIT License
3.84k stars 628 forks source link

Null check operator used on a null value #774

Closed zhongzf1 closed 8 months ago

zhongzf1 commented 8 months ago

indicator_notifier.dart in IndicatorNotifier._canProcess at line 277 within easy_refresh indicator_notifier.dart in IndicatorNotifier.callTask at line 433 within easy_refresh easy_refresh.dart in _EasyRefreshState._callRefresh at line 476 within easy_refresh easy_refresh.dart in _EasyRefreshState.initState.. at line 338 within easy_refresh Called from: binding.dart in SchedulerBinding._invokeFrameCallback within flutter

我看了源码,发现_EasyRefreshState.initState里,_callRefresh的调用是在addPostFrameCallback的监听里面调用的,假如这个监听在_EasyRefreshState销毁之后才回调,那么_callRefresh里面的_canProcess => _onCanProcess!.call()就会因为_onCanProcess为空,导致出现Null check operator used on a null value的报错

xuelongqy commented 8 months ago

3.3.2+4 已解决