flutter_pdfview 2.0.0-beta.2
flutter_pdfview: ^2.0.0-beta.2 copied to clipboard
A Flutter plugin that provides a PDFView widget on Android and iOS.
// The flutter_pdfview showcase: a reader, every document source, the text
// layer, passwords, and a playground with every option and callback.
//
// Each screen lives in lib/src/ and is written to be copied into an app.
import 'package:flutter/material.dart';
import 'src/home_screen.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
ThemeMode _themeMode = ThemeMode.system;
void _cycleTheme() {
setState(() {
_themeMode = switch (_themeMode) {
ThemeMode.system => ThemeMode.light,
ThemeMode.light => ThemeMode.dark,
ThemeMode.dark => ThemeMode.system,
};
});
}
@override
Widget build(BuildContext context) {
const Color seed = Color(0xFFD32F2F);
return MaterialApp(
title: 'flutter_pdfview',
debugShowCheckedModeBanner: false,
theme: ThemeData(colorSchemeSeed: seed, useMaterial3: true),
darkTheme: ThemeData(colorSchemeSeed: seed, brightness: Brightness.dark, useMaterial3: true),
themeMode: _themeMode,
home: HomeScreen(themeMode: _themeMode, onCycleTheme: _cycleTheme),
);
}
}