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.89k stars 633 forks source link

flutter_easy_refresh + get 遇到问题 #763

Closed emodeqidao closed 11 months ago

emodeqidao commented 1 year ago

作者你好: A页面使用了 刷新 EasyRefresh , 也设置了refreshController ,跟着跳转到第二个页面 ,第三个页面,在第三个页面调用 Get.offAllNamed(/A页面)【删除所有以前的路由并转到新路由】。 这个时候A页面的EasyRefresh 的header 下来刷新是回不去的。求解 附带demo https://github.com/emodeqidao/testdemo

flutter: 3.13.4

easy_refresh: 3.3.2+1 get: 4.6.6

HiUSB commented 1 year ago

你应该重写RootpageView的controller,并加上tag。

class RootpageView extends GetView<RootpageController> {
  RootpageView({Key? key}) : super(key: key);

  @override
  final controller = Get.put(RootpageController(), tag: UniqueKey().toString());

...
emodeqidao commented 1 year ago

你应该重写RootpageView的controller,并加上tag。

class RootpageView extends GetView<RootpageController> {
  RootpageView({Key? key}) : super(key: key);

  @override
  final controller = Get.put(RootpageController(), tag: UniqueKey().toString());

...

谢谢