Skip to main content

flutter_pdfview 2.0.0-beta.2 copy "flutter_pdfview: ^2.0.0-beta.2" to clipboard
flutter_pdfview: ^2.0.0-beta.2 copied to clipboard

A Flutter plugin that provides a PDFView widget on Android and iOS.

example/lib/main.dart

// 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),
    );
  }
}
751
likes
150
points
474k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin that provides a PDFView widget on Android and iOS.

Repository (GitHub)
View/report issues

Topics

#pdf #viewer #native

License

MIT (license)

Dependencies

flutter, flutter_pdfview_platform_interface

More

Packages that depend on flutter_pdfview

Packages that implement flutter_pdfview