peng8350 / flutter_pulltorefresh

a widget provided to the flutter scroll component drop-down refresh and pull up load.
MIT License
2.71k stars 722 forks source link

refresh and load not #538

Open Osmancn opened 3 years ago

Osmancn commented 3 years ago

refresh and load not trigger with mouse scroll on web(flutter 2.5.0)

PcolBP commented 3 years ago

Did you migrate using this guide after upgrading flutter?

Osmancn commented 3 years ago

Did you migrate using this guide after upgrading flutter?

i did.scrolling is not problem but not trigger refresh and load action

Osmancn commented 3 years ago

https://user-images.githubusercontent.com/37872740/133758801-f32432d6-51b9-43d5-be8a-46fda957246b.mov

stakan335 commented 3 years ago

hi, can you attach your code

kim-can commented 3 years ago

flutter 2.5.0 https://flutter.dev/docs/release/breaking-changes/default-scroll-behavior-drag

Is there no adaptation?

mac os loadmore not work. skipCanRefresh = true,

Need to pull down manually!

On mac computers, three-finger pull-down can start and two-finger scrolling is not possible.

laurentguenver-a commented 2 years ago

I have the same problem. Any solution ? I must refresh to load more...

vlladislav45 commented 2 years ago

@skyJinc i had similar problem to the web, the infinity scroll just didn't works so i just started to search about the issue and i saw this migration tutorial here: https://flutter.dev/docs/release/breaking-changes/default-scroll-behavior-drag . It helped to me to solve my problem but it would be better if that topic is added to the dependency's documentation.

Shamik07 commented 3 months ago

View this: flutter_pulltorefresh Pull Request #636

tldr;

ScrollConfiguration(
  behavior: ScrollConfiguration.of(context).copyWith(
    dragDevices: {
      PointerDeviceKind.touch,
      PointerDeviceKind.mouse,
      PointerDeviceKind.trackpad,
      PointerDeviceKind.stylus,
    },
  ),
  child: SmartRefresher(
    enablePullDown: true,
    header: WaterDropHeader(),
    enablePullUp: true,
    footer: CustomFooter(
      builder: (BuildContext context, LoadStatus mode) {
        Widget body;
        if (mode == LoadStatus.idle) {
          body = Text("pull up load");
        } else if (mode == LoadStatus.loading) {
          body = CupertinoActivityIndicator();
        } else if (mode == LoadStatus.failed) {
          body = Text("Load Failed! Click retry!");
        } else if (mode == LoadStatus.canLoading) {
          body = Text("release to load more");
        } else {
          body = Text("No more Data");
        }
        return Container(
          height: 55.0,
          child: Center(child: body),
        );
      },
    ),
    controller: _refreshController,
    onRefresh: _onRefresh, // Check example above for this method
    onLoading: _onLoading, // Check example above for this method
    child: Offstage(), // Replace with your own widget
  ),
);