dashboard
repositories
activity
search
login
APPS
/
PAILot
summary
reflog
commits
tree
compare
forks
blame
|
history
|
raw
|
HEAD
feat: inline PDF viewer with pinch-to-zoom
Matthias Nott
5 days ago
c9739ac4a22733d45167173446c1d3ce65a767eb
[APPS/PAILot.git]
/
lib
/
widgets
/
pdf_viewer.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:pdfrx/pdfrx.dart';
/// Full-screen PDF viewer with pinch-to-zoom and page navigation.
class PdfViewerScreen extends StatelessWidget {
final Uint8List pdfBytes;
final String title;
const PdfViewerScreen({
super.key,
required this.pdfBytes,
this.title = 'PDF',
});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title, style: const TextStyle(fontSize: 16)),
backgroundColor: Colors.black87,
foregroundColor: Colors.white,
),
backgroundColor: Colors.grey[900],
body: PdfViewer.data(pdfBytes, sourceName: title),
);
}
}