pdfrx 1.0.97 pdfrx: ^1.0.97 copied to clipboard
pdfrx is a rich and fast PDF viewer implementation built on the top of PDFium. The plugin supports Android, iOS, Windows, macOS, Linux, and Web.
Minimum Example #
import 'package:flutter/material.dart';
import 'package:pdfrx/pdfrx.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Pdfrx example',
home: MainPage(),
);
}
}
class MainPage extends StatefulWidget {
const MainPage({super.key});
@override
State<MainPage> createState() => _MainPageState();
}
class _MainPageState extends State<MainPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(Icons.menu),
onPressed: () {
showLeftPane.value = !showLeftPane.value;
},
),
title: const Text('Pdfrx example'),
),
body: PdfViewer.asset(
'assets/password_protected_sample.pdf',
passwordProvider: () => 'test',
),
);
}
}