Skip to content

Commit

Permalink
Forked InteractiveViewer code to support wheel-to-scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
espresso3389 committed Dec 28, 2023
1 parent 38bbd64 commit fb47181
Show file tree
Hide file tree
Showing 4 changed files with 1,441 additions and 6 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"sublist",
"Subrect",
"TEXTPAGE",
"trackpad",
"unawaited",
"uncollapsed",
"unregister",
Expand Down
10 changes: 9 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:pdfrx/pdfrx.dart';
Expand Down Expand Up @@ -26,6 +28,9 @@ class _MyAppState extends State<MyApp> {
super.dispose();
}

final _isDesktop =
kIsWeb || Platform.isWindows || Platform.isLinux || Platform.isMacOS;

@override
Widget build(BuildContext context) {
return MaterialApp(
Expand All @@ -40,8 +45,11 @@ class _MyAppState extends State<MyApp> {
? 'assets/hello.pdf'
: 'https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf'),
controller: controller,
displayParams: const PdfViewerParams(
displayParams: PdfViewerParams(
maxScale: 8,
// FIXME: if it's desktop, text selection feature is not correctly working now.
// Even on mobile platforms, it is still very experimental. Please take extreme care when using it.
enableTextSelection: !_isDesktop,
),
),
AnimatedPositioned(
Expand Down
Loading

0 comments on commit fb47181

Please sign in to comment.