Skip to content

Commit

Permalink
update pdfx to support SurfaceProducer
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Nov 29, 2024
1 parent 1ad9b94 commit 4bb307a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 12 deletions.
11 changes: 7 additions & 4 deletions lib/Frontend/pages/view_pdf.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -31,6 +31,7 @@ class _ViewPDFState extends State<ViewPDF> {
double progress = 0;

Uint8List? data;
PdfControllerPinch? pdfPinchController;

@override
void dispose() {
Expand Down Expand Up @@ -88,9 +89,11 @@ class _ViewPDFState extends State<ViewPDF> {
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(
Expand Down
37 changes: 31 additions & 6 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4bb307a

Please sign in to comment.