简体   繁体   English

为 Flutter 列表添加向上和向下翻页的物理键盘支持

[英]Add physical keyboard support for page up and page down to Flutter lists

Since Flutter 2.0, there is support for desktop hardware keys, but widgets like scrollable_positioned_list don't support it.从 Flutter 2.0 开始,支持桌面硬件键,但像 scrollable_positioned_list 这样的小部件不支持。

I found the problem is if I set primary parameter of ScrollView to true, it will accept PageUp and PageDown of physical keyboard, but the problem is I need to set ScrollController too, which can't be set with primary at same time.我发现问题是如果我将ScrollView的primary参数设置为true,它将接受物理键盘的PageUp和PageDown,但问题是我也需要设置ScrollController,不能与primary同时设置。

Any suggestion?有什么建议吗?

(I tested it on Windows and Mac) (我在 Windows 和 Mac 上测试过)

have you checked out the release notes for Flutter 2.2?您查看过 Flutter 2.2 的发行说明吗? They added some corrections in relation to the PageUp and the PageDown through the physical keyboard.他们通过物理键盘添加了一些与 PageUp 和 PageDown 相关的更正。

Follow the link for the Flutter 2.2's announcement: https://medium.com/flutter/whats-new-in-flutter-2-2-fd00c65e2039按照 Flutter 2.2 公告的链接: https://medium.com/flutter/whats-new-in-flutter-2-2-fd00c65e2039

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM