-
Notifications
You must be signed in to change notification settings - Fork 64
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: scroll by mouse-wheel #10
Comments
You can refer to the following ideas, but I haven't written the specific code yet. First, set the Timer? _scrollTimer;
bool isScrolled = false;
return Listener(
onPointerSignal: (event) {
isScrolled = true;
if (event is PointerScrollEvent) {
/// Set scroll position
jumpTo(
xOffset: currentOffset.dx + event.scrollDelta.dx,
yOffset: currentOffset.dy + event.scrollDelta.dy);
}
_scrollTimer?.cancel();
_scrollTimer = Timer(
const Duration(milliseconds: 100),
() {
isScrolled = false;
},
);
},
child: Container(
color: widget.params.backgroundColor,
child: Stack(
children: [
InteractiveViewer(
scaleEnabled: false,
...... |
I'm just considering to fork the original InteractiveViewer to support scroll-by-mouse-wheel. |
0.3.2 now supports |
Currently, PdfViewer does not support scroll by mouse-wheel on desktop platforms.
We'd better support scroll by mouse-wheel but we should investigate the way to implement it.
According to flutter/flutter#121961, they don't want to implement scroll by mouse-wheel on InteractiveViewer anyway.
So, the approach may be one of
The text was updated successfully, but these errors were encountered: