flutter_indzooom_pdf_viewer 1.0.8

flutter_plugin_pdf_viewer #

A flutter plugin for handling PDF files. Works on both Android & iOS

Installation #

Add flutter_plugin_pdf_viewer as a dependency in your pubspec.yaml file.

flutter_plugin_pdf_viewer: any

Android #

No permissions required. Uses application cache directory.

iOS #

No permissions required.

How-to: #

Load PDF #

// Load from assets
PDFDocument doc = await PDFDocument.fromAsset('assets/test.pdf');
// Load from URL
PDFDocument doc = await PDFDocument.fromURL('http://www.africau.edu/images/default/sample.pdf');

// Load from file
File file  = File('...');
PDFDocument doc = await PDFDocument.fromFile(file);

Load pages #

// Load specific page
PDFPage pageOne = await doc.get(page: _number);

Pre-built viewer #

Use the pre-built PDF Viewer

  Widget build(BuildContext context) {
        appBar: AppBar(
          title: Text('Example'),
        body: Center(
        child: _isLoading
            ? Center(child: CircularProgressIndicator())
            : PDFViewer(document: document)),

This code produces the following view:

Demo Screenshot 1


  • Allow password-protected files
  • Refactor PDFDocument.getAll() method
  • Increase page resolution
  • Add swipe to change page

Third-party packages used #

path_providerA Flutter plugin for finding commonly used locations on the filesystem. Supports iOS and Android.
flutter_cache_managerA CacheManager to download and cache files in the cache directory of the app. Various settings on how long to keep a file can be changed.
numberpickerNumberPicker is a custom widget designed for choosing an integer or decimal number by scrolling spinners.
flutter_advanced_networkimageAn advanced image provider provides caching and retrying for flutter app. Now with zoomable widget and transition to image widget.

1.0.8 #

  • Updated Circular progress indicator colors
  • Updated third-party dependencies

1.0.7 #

  • Updated project to meet changed requirements by Flutter
  • Updated third-party dependencies
  • Fixes issue #21, #23

1.0.6 #

  • Fixed issue in 1.0.5 on iOS that caused xcode build to fail

1.0.5 #

  • Fixed bug in iOS where due to caching of Flutter ImageProvider when switching documents old pages would persist
  • Added more cases in example demo

1.0.4 #

  • Refactored PDFdocument.getAllPages() method (Thanks for @SergioBernal8 for PR )
  • Added white background to page (iOS)
  • Changed page resolution in iOS to 300 dpi
  • Moved tooltips to a proper class

1.0.3 #

  • Added white background to page (Android)
  • Fixed cocoapods name
  • User can now define tooltips and page selection dialog strings
  • Tapping on page indicator now prompts to user to page selection dialog
  • Added zoom to PDFPage

1.0.2 #

  • Bottom appbar no longer appears if PDF has only one page (Thanks for @markathomas for suggesting this )
  • Fixed opening PDF from assets not working.
  • Example now opens file from assets

1.0.1 #

  • Updated readme.md and added screenshots to package

1.0.0 #

  • Initial release


flutter_pdf_viewer_example #

Demonstrates how to use the flutter_pdf_viewer plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_indzooom_pdf_viewer: ^1.0.8

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_indzooom_pdf_viewer/flutter_indzooom_pdf_viewer.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 21, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7

Health suggestions

Format lib/src/viewer.dart.

Run flutter format to format lib/src/viewer.dart.

Maintenance issues and suggestions

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (flutter_advanced_networkimage, rxdart).

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/giulianojordao/flutter_indzooom_pdf_viewer was unreachable.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
flutter_advanced_networkimage ^0.5.0 0.5.0 0.7.0
flutter_cache_manager ^1.0.0 1.1.3
numberpicker ^1.0.0 1.1.0
path_provider ^1.1.0 1.6.1
rxdart ^0.21.0 0.21.0 0.23.1
Transitive dependencies
async 2.4.0
charcode 1.1.3
collection 1.14.11 1.14.12
convert 2.1.1
crypto 2.1.4
flutter_svg 0.13.1 0.17.1
http 0.12.0+4
http_parser 3.1.3
infinite_listview 1.0.1+1
meta 1.1.8
path 1.6.4
path_drawing 0.4.1
path_parsing 0.1.4
pedantic 1.9.0
petitparser 3.0.1
platform 2.2.1
sky_engine 0.0.99
source_span 1.6.0
sqflite 1.2.1
string_scanner 1.0.5
synchronized 2.2.0
term_glyph 1.1.0
typed_data 1.1.6
uuid 2.0.4
vector_math 2.0.8
xml 3.7.0