Skip to content

Commit

Permalink
Upgrade example's gradle configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
espresso3389 committed Nov 2, 2024
1 parent 6e52b24 commit 1ff0af9
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 36 deletions.
8 changes: 4 additions & 4 deletions example/viewer/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ plugins {
android {
namespace "jp.espresso3389.pdfrx_example"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
ndkVersion "27.0.12077973"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_18
targetCompatibility JavaVersion.VERSION_18
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = 18
}

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip
4 changes: 2 additions & 2 deletions example/viewer/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
id "com.android.application" version "8.7.0" apply false
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
}

include ":app"
28 changes: 10 additions & 18 deletions example/viewer/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "5.0.0"
flutter_localizations:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -153,10 +153,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "5.0.0"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -309,10 +309,10 @@ packages:
dependency: "direct main"
description:
name: synchronized
sha256: a824e842b8a054f91a728b783c177c1e4731f6b124f9192468457a8913371255
sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225"
url: "https://pub.dev"
source: hosted
version: "3.2.0"
version: "3.3.0+3"
term_glyph:
dependency: transitive
description:
Expand Down Expand Up @@ -341,10 +341,10 @@ packages:
dependency: "direct main"
description:
name: url_launcher
sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3"
sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603"
url: "https://pub.dev"
source: hosted
version: "6.3.0"
version: "6.3.1"
url_launcher_android:
dependency: transitive
description:
Expand Down Expand Up @@ -413,10 +413,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.4"
version: "14.2.5"
web:
dependency: transitive
description:
Expand All @@ -425,14 +425,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.0"
win32:
dependency: "direct overridden"
description:
name: win32
sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a"
url: "https://pub.dev"
source: hosted
version: "5.5.4"
xdg_directories:
dependency: transitive
description:
Expand Down
9 changes: 3 additions & 6 deletions example/viewer/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ dependencies:

cupertino_icons: ^1.0.8
rxdart: ^0.28.0
url_launcher: ^6.3.0
synchronized: ^3.1.0
url_launcher: ^6.3.1
synchronized: ^3.3.0

dev_dependencies:
flutter_test:
sdk: flutter

flutter_lints: ^4.0.0

dependency_overrides:
win32: ^5.5.1
flutter_lints: ^5.0.0

flutter:
uses-material-design: true
Expand Down
13 changes: 8 additions & 5 deletions lib/src/widgets/pdf_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -867,11 +867,14 @@ class _PdfViewerState extends State<PdfViewer>

void _onSelectionChange(PdfTextRanges selection) {
_selectionChangedThrottleTimer?.cancel();
_selectionChangedThrottleTimer = Timer(const Duration(milliseconds: 300), () {
if (!mounted || !_selectionHandlers.containsKey(selection.pageNumber)) return;
widget.params.onTextSelectionChange?.call(
_selectionHandlers.values.map((s) => s.selectedRanges).where((s) => s.isNotEmpty).toList()
);
_selectionChangedThrottleTimer =
Timer(const Duration(milliseconds: 300), () {
if (!mounted || !_selectionHandlers.containsKey(selection.pageNumber))
return;
widget.params.onTextSelectionChange?.call(_selectionHandlers.values
.map((s) => s.selectedRanges)
.where((s) => s.isNotEmpty)
.toList());
});
}

Expand Down

0 comments on commit 1ff0af9

Please sign in to comment.