Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

desktop mac 程序上拉下拉都不好用 #544

Open
WymanY opened this issue Oct 26, 2021 · 6 comments
Open

desktop mac 程序上拉下拉都不好用 #544

WymanY opened this issue Oct 26, 2021 · 6 comments

Comments

@WymanY
Copy link

WymanY commented Oct 26, 2021

image
pull refresh 版本2.0
mac : Apple M1 ,11.6系统
表现形式:无法上拉和下拉
调用方式如下:
image

@NetFly-VPN
Copy link

windows 上也不能下拉刷新了

@yiky84119
Copy link

yiky84119 commented Oct 28, 2021

Widget build(BuildContext context) {
    return GetMaterialApp(
      scrollBehavior: MyCustomScrollBehavior()
}

class MyCustomScrollBehavior extends MaterialScrollBehavior {
  @override
  Set<PointerDeviceKind> get dragDevices => {
    PointerDeviceKind.touch,
    PointerDeviceKind.mouse,
    // etc.
  };
}

@d1y
Copy link

d1y commented Nov 13, 2021

Widget build(BuildContext context) {
    return GetMaterialApp(
      scrollBehavior: MyCustomScrollBehavior()
}

class MyCustomScrollBehavior extends MaterialScrollBehavior {
  @override
  Set<PointerDeviceKind> get dragDevices => {
    PointerDeviceKind.touch,
    PointerDeviceKind.mouse,
    // etc.
  };
}

感谢

d1y added a commit to waifu-project/movie that referenced this issue Nov 13, 2021
支持此操作之后, 就可以解决 `flutter_pulltorefresh` 插件的上划和加载更多的手势操作

https: //github.com/peng8350/flutter_pulltorefresh/issues/544#issuecomment-953643946
Co-Authored-By: Nevo <nevo.lee@gmail.com>
@fzyzcjy
Copy link
Contributor

fzyzcjy commented Mar 10, 2022

A minor modified version from @yiky84119 to avoid breaking original behavior:

Widget build(BuildContext context) {
    return GetMaterialApp(
      scrollBehavior: MyCustomScrollBehavior()
}

class MyCustomScrollBehavior extends MaterialScrollBehavior {
  @override
  Set<PointerDeviceKind> get dragDevices => {
    ...super.dragDevices,
    PointerDeviceKind.mouse,
  };
}

By the way, the comments of dragDevices says:

  /// The device kinds that the scrollable will accept drag gestures from.
  ///
  /// By default only [PointerDeviceKind.touch], [PointerDeviceKind.stylus], and
  /// [PointerDeviceKind.invertedStylus] are configured to create drag gestures.
  /// Enabling this for [PointerDeviceKind.mouse] will make it difficult or
  /// impossible to select text in scrollable containers and is not recommended.

So mouse may not be the suggested approach.

@rahulvyas
Copy link

rahulvyas commented Jul 12, 2022

Pull up and pull down both not working on the M1 Mac chrome browser. Tried adding PointerDeviceKind.trackpad, but no luck. Does anyone know any fix?

@huangsir0
Copy link

感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants