From 4bb307adafac611d4ca2ec83b0d47982cbf58eb5 Mon Sep 17 00:00:00 2001 From: Codel1417 Date: Fri, 29 Nov 2024 10:40:27 -0500 Subject: [PATCH] update pdfx to support SurfaceProducer --- lib/Frontend/pages/view_pdf.dart | 11 ++++++---- pubspec.lock | 37 ++++++++++++++++++++++++++------ pubspec.yaml | 7 ++++-- 3 files changed, 43 insertions(+), 12 deletions(-) diff --git a/lib/Frontend/pages/view_pdf.dart b/lib/Frontend/pages/view_pdf.dart index e8df8615..a8fd7078 100644 --- a/lib/Frontend/pages/view_pdf.dart +++ b/lib/Frontend/pages/view_pdf.dart @@ -3,7 +3,7 @@ import 'dart:typed_data'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:pdfrx/pdfrx.dart'; +import 'package:pdfx/pdfx.dart'; import 'package:tail_app/Frontend/utils.dart'; import 'package:tail_app/constants.dart'; @@ -31,6 +31,7 @@ class _ViewPDFState extends State { double progress = 0; Uint8List? data; + PdfControllerPinch? pdfPinchController; @override void dispose() { @@ -88,9 +89,11 @@ class _ViewPDFState extends State { key: ValueKey(data != null), builder: (context) { if (data != null) { - return PdfViewer.data( - data!, - sourceName: widget.pdfInfo.title, + pdfPinchController ??= PdfControllerPinch( + document: PdfDocument.openData(data!), + ); + return PdfViewPinch( + controller: pdfPinchController!, ); } else { return Center( diff --git a/pubspec.lock b/pubspec.lock index d7cbefee..b4f1aba9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -479,6 +479,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.7" + extension: + dependency: transitive + description: + name: extension + sha256: be3a6b7f8adad2f6e2e8c63c895d19811fcf203e23466c6296267941d0ff4f24 + url: "https://pub.dev" + source: hosted + version: "0.6.0" fading_edge_scrollview: dependency: "direct main" description: @@ -1262,14 +1270,15 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.0" - pdfrx: + pdfx: dependency: "direct main" description: - name: pdfrx - sha256: "9a0a9659ff2a0fd1f0057d66e936395f9d9d1043242e58f3f203134055cbe5bf" - url: "https://pub.dev" - source: hosted - version: "1.0.91" + path: "packages/pdfx" + ref: HEAD + resolved-ref: b3ede682cf9dba578d0d9011597121bf7d723ebd + url: "https://github.com/Codel1417/packages.flutter" + source: git + version: "2.8.0" pedometer: dependency: "direct main" description: @@ -1334,6 +1343,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.0.2" + photo_view: + dependency: transitive + description: + name: photo_view + sha256: "1fc3d970a91295fbd1364296575f854c9863f225505c28c46e0a03e48960c75e" + url: "https://pub.dev" + source: hosted + version: "0.15.0" platform: dependency: "direct main" description: @@ -1788,6 +1805,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.2" + universal_platform: + dependency: transitive + description: + name: universal_platform + sha256: "64e16458a0ea9b99260ceb5467a214c1f298d647c659af1bff6d3bf82536b1ec" + url: "https://pub.dev" + source: hosted + version: "1.1.0" upgrader: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 5523ef4d..842b6179 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -81,8 +81,11 @@ dependencies: flutter_widget_from_html_core: ^0.15.2 visibility_detector: ^0.4.0+2 # used on the tail blog widgets lottie: ^3.1.3 - pdfrx: ^1.0.91 - + #pdfrx: ^1.0.91 + pdfx: + git: + url: https://github.com/Codel1417/packages.flutter + path: packages/pdfx # Dio HTTP dio: ^5.7.0 dio_smart_retry: ^7.0.1