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

TF-3246 Fix PDF viewer scrollbar not working #3343

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions contact/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -836,26 +836,26 @@ packages:
dependency: transitive
description:
name: path_provider
sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.5"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72
sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
version: "2.2.10"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d"
sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
version: "2.4.1"
path_provider_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -916,10 +916,10 @@ packages:
dependency: transitive
description:
name: plugin_platform_interface
sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev"
source: hosted
version: "2.1.6"
version: "2.1.8"
pointer_interceptor:
dependency: transitive
description:
Expand Down Expand Up @@ -1162,26 +1162,26 @@ packages:
dependency: transitive
description:
name: url_launcher
sha256: "75f2846facd11168d007529d6cd8fcb2b750186bea046af9711f10b907e1587e"
sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603"
url: "https://pub.dev"
source: hosted
version: "6.1.10"
version: "6.3.1"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def"
sha256: f0c73347dfcfa5b3db8bc06e1502668265d39c08f310c29bff4e28eea9699f79
url: "https://pub.dev"
source: hosted
version: "6.2.0"
version: "6.3.9"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "4ac97281cf60e2e8c5cc703b2b28528f9b50c8f7cebc71df6bdf0845f647268a"
sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626"
url: "https://pub.dev"
source: hosted
version: "6.2.0"
version: "6.3.2"
url_launcher_linux:
dependency: transitive
description:
Expand All @@ -1202,10 +1202,10 @@ packages:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50"
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.3.2"
url_launcher_web:
dependency: transitive
description:
Expand Down Expand Up @@ -1319,5 +1319,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.20.0-7.0.pre.48"
dart: ">=3.4.0 <4.0.0"
flutter: ">=3.22.0"
30 changes: 15 additions & 15 deletions core/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -797,26 +797,26 @@ packages:
dependency: "direct main"
description:
name: path_provider
sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.5"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72
sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
version: "2.2.10"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d"
sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
version: "2.4.1"
path_provider_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -1099,26 +1099,26 @@ packages:
dependency: "direct main"
description:
name: url_launcher
sha256: "75f2846facd11168d007529d6cd8fcb2b750186bea046af9711f10b907e1587e"
sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603"
url: "https://pub.dev"
source: hosted
version: "6.1.10"
version: "6.3.1"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def"
sha256: f0c73347dfcfa5b3db8bc06e1502668265d39c08f310c29bff4e28eea9699f79
url: "https://pub.dev"
source: hosted
version: "6.2.0"
version: "6.3.9"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "4ac97281cf60e2e8c5cc703b2b28528f9b50c8f7cebc71df6bdf0845f647268a"
sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626"
url: "https://pub.dev"
source: hosted
version: "6.2.0"
version: "6.3.2"
url_launcher_linux:
dependency: transitive
description:
Expand All @@ -1139,10 +1139,10 @@ packages:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50"
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.3.2"
url_launcher_web:
dependency: transitive
description:
Expand Down Expand Up @@ -1257,4 +1257,4 @@ packages:
version: "3.1.2"
sdks:
dart: ">=3.4.0 <4.0.0"
flutter: ">=3.20.0-7.0.pre.48"
flutter: ">=3.22.0"
4 changes: 2 additions & 2 deletions core/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies:

flutter_inappwebview: 6.0.0

url_launcher: 6.1.10
url_launcher: 6.3.1

universal_html: 2.2.4

Expand All @@ -80,7 +80,7 @@ dependencies:

http_parser: 4.0.2

path_provider: 2.1.1
path_provider: 2.1.5

collection: 1.18.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:core/utils/app_logger.dart';
import 'package:flutter/material.dart';
import 'package:pdf_render/pdf_render_widgets.dart';
import 'package:pdfrx/pdfrx.dart';
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';

enum ZoomState {
Expand Down Expand Up @@ -160,7 +160,7 @@ class _PaginationPDFViewerState extends State<PaginationPDFViewer> {
}

void _pageChanged({String? property}) {
_pageCurrentNotifier.value = widget.pdfViewerController?.currentPageNumber ?? 1;
_pageCurrentNotifier.value = widget.pdfViewerController?.pageNumber ?? 1;
_updateZoomState();
}

Expand All @@ -182,7 +182,10 @@ class _PaginationPDFViewerState extends State<PaginationPDFViewer> {
_zoomLevel = 4.0;
}
_updateZoomState();
widget.pdfViewerController?.setZoomRatio(zoomRatio: _zoomLevel);
widget.pdfViewerController?.setZoom(
widget.pdfViewerController!.centerPosition,
_zoomLevel,
);
}
}

Expand All @@ -204,12 +207,15 @@ class _PaginationPDFViewerState extends State<PaginationPDFViewer> {
_zoomLevel = 3.5;
}
_updateZoomState();
widget.pdfViewerController?.setZoomRatio(zoomRatio: _zoomLevel);
widget.pdfViewerController?.setZoom(
widget.pdfViewerController!.centerPosition,
_zoomLevel,
);
}
}

void _updateZoomState() {
final zoomLevel = widget.pdfViewerController?.zoomRatio ?? 1.0;
final zoomLevel = widget.pdfViewerController?.currentZoom ?? 1.0;
log('_PaginationPDFViewerState::_updateZoomState:zoomLevel = $zoomLevel');
if (zoomLevel <= _maxZoomLevelDefault && zoomLevel > _minZoomLevelDefault) {
_zoomOutPageNotifier.value = ZoomState.activate;
Expand Down
Loading
Loading