peng8350 / flutter_pulltorefresh

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

After upgrade Flutter to 2.5.0 flutter web pull up not work #536

Open bailyzheng opened 3 years ago

bailyzheng commented 3 years ago

It work well in Android platform.

Osmancn commented 3 years ago

It work well in Android platform.

It work well in Android platform.

use scrollbehavior look up=>https://flutter.dev/docs/release/breaking-changes/default-scroll-behavior-drag

bailyzheng commented 2 years ago

It work well in Android platform.

It work well in Android platform.

use scrollbehavior look up=>https://flutter.dev/docs/release/breaking-changes/default-scroll-behavior-drag

It works OK when I add this to wrapper SmartRefresher. Thanks

              child: ScrollConfiguration(
                  behavior:
                      ScrollConfiguration.of(context).copyWith(dragDevices: {
                    PointerDeviceKind.touch,
                    PointerDeviceKind.mouse,
                  })
SalahAdDin commented 2 years ago

It is not working for me at all.

It work well in Android platform.

It work well in Android platform.

use scrollbehavior look up=>https://flutter.dev/docs/release/breaking-changes/default-scroll-behavior-drag

It works OK when I add this to wrapper SmartRefresher. Thanks

              child: ScrollConfiguration(
                  behavior:
                      ScrollConfiguration.of(context).copyWith(dragDevices: {
                    PointerDeviceKind.touch,
                    PointerDeviceKind.mouse,
                  })

Can you give us and example on it?

Mae623 commented 2 years ago

It work well in Android platform.

It work well in Android platform.

use scrollbehavior look up=>https://flutter.dev/docs/release/breaking-changes/default-scroll-behavior-drag

It works for me. Thanks~

shatanikmahanty commented 1 year ago

For those who stumbled upon this issue recently you need to add the ScrollConfiguration to the refresher widget instead of the child of refresher.

Eg:

ScrollConfiguration(
      behavior: ScrollConfiguration.of(context).copyWith(
        dragDevices: {
          PointerDeviceKind.touch,
          PointerDeviceKind.mouse,
          PointerDeviceKind.trackpad,
          PointerDeviceKind.stylus,
        },
      ),
      child: SmartRefresher(
        enablePullDown: true,
        header: BezierCircleHeader(
          bezierColor: YOUR_COLOR,
          circleColor: Colors.white,
        ),
        footer: CustomFooter(
          builder: (BuildContext context, LoadStatus mode) {
            Widget body;
            if (mode == LoadStatus.idle || mode == LoadStatus.loading) {
              body = CircularProgressIndicator.adaptive();
            } else if (mode == LoadStatus.failed) {
              body = Text("Load Failed!Please Retry!");
            } else {
              body = Text("No more Data");
            }
            return Container(
              height: 55.0,
              child: Center(child: body),
            );
          },
        ),
        controller: _refreshController,
        onRefresh: () async {
        },
        child: YourChildWidget(),
      ),
    );
SalahAdDin commented 1 year ago

For those who stumbled upon this issue recently you need to add the ScrollConfiguration to the refresher widget instead of the child of refresher.

Eg:

ScrollConfiguration(
      behavior: ScrollConfiguration.of(context).copyWith(
        dragDevices: {
          PointerDeviceKind.touch,
          PointerDeviceKind.mouse,
          PointerDeviceKind.trackpad,
          PointerDeviceKind.stylus,
        },
      ),
      child: SmartRefresher(
        enablePullDown: true,
        header: BezierCircleHeader(
          bezierColor: YOUR_COLOR,
          circleColor: Colors.white,
        ),
        footer: CustomFooter(
          builder: (BuildContext context, LoadStatus mode) {
            Widget body;
            if (mode == LoadStatus.idle || mode == LoadStatus.loading) {
              body = CircularProgressIndicator.adaptive();
            } else if (mode == LoadStatus.failed) {
              body = Text("Load Failed!Please Retry!");
            } else {
              body = Text("No more Data");
            }
            return Container(
              height: 55.0,
              child: Center(child: body),
            );
          },
        ),
        controller: _refreshController,
        onRefresh: () async {
        },
        child: YourChildWidget(),
      ),
    );

Is this added to the documentation?

shatanikmahanty commented 1 year ago

For those who stumbled upon this issue recently you need to add the ScrollConfiguration to the refresher widget instead of the child of refresher.

Eg:

ScrollConfiguration(
      behavior: ScrollConfiguration.of(context).copyWith(
        dragDevices: {
          PointerDeviceKind.touch,
          PointerDeviceKind.mouse,
          PointerDeviceKind.trackpad,
          PointerDeviceKind.stylus,
        },
      ),
      child: SmartRefresher(
        enablePullDown: true,
        header: BezierCircleHeader(
          bezierColor: YOUR_COLOR,
          circleColor: Colors.white,
        ),
        footer: CustomFooter(
          builder: (BuildContext context, LoadStatus mode) {
            Widget body;
            if (mode == LoadStatus.idle || mode == LoadStatus.loading) {
              body = CircularProgressIndicator.adaptive();
            } else if (mode == LoadStatus.failed) {
              body = Text("Load Failed!Please Retry!");
            } else {
              body = Text("No more Data");
            }
            return Container(
              height: 55.0,
              child: Center(child: body),
            );
          },
        ),
        controller: _refreshController,
        onRefresh: () async {
        },
        child: YourChildWidget(),
      ),
    );

Is this added to the documentation?

Not sure actually

SalahAdDin commented 1 year ago

Could you open a new MR to add this to the documentation?

shatanikmahanty commented 1 year ago

Could you open a new MR to add this to the documentation?

Sure, will try to do it this week 🙌

shatanikmahanty commented 1 year ago

Could you open a new MR to add this to the documentation?

@SalahAdDin done 🙌

RUSSCITY commented 7 months ago

There still be small problem with this implementation: when we use scroll on mouse (not dragging the screen) then "onLoading" is never triggered...