native_pdf_view 1.0.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new80

native_pdf_view #

Flutter Plugin to render a PDF file. Supports both Android and iOS.

Getting Started #

In your flutter project add the dependency:

pub package

dependencies:
  ...
  native_pdf_view: any

For help getting started with Flutter, view the online documentation.

Usage example #

Import native_pdf_view.dart

import 'package:native_pdf_view/native_pdf_view.dart';

Rendering PDF files on Android devices #

Use the provided widget PdfRenderer in order to render a PDF file. This plugin uses the Android native PdfRenderer to render the pages of PDF files and provides a widget called PdfRenderer to display the PDF page you like.

1.0.2 #

  • Update example readme

1.0.1 #

  • Fix package details

1.0.0 #

  • Initial release

example/README.md

native_pdv_view #

Demonstrates how to use the flutter_pdf_renderer plugin.

import 'package:flutter/material.dart';
import 'package:native_pdf_view/native_pdf_view.dart';
import 'package:photo_view/photo_view.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('NativePDFView example app'),
        ),
        body: Container(
          child: NativePDFView(
            // Load from assets
            pdfFile: 'assets/sample.pdf',
            sAsset: true,
            // or load from file system
            // pdfFile: 'path/to/file',
            // isAsset: false,
            pageBuilder: (imageFile) => PhotoView(
              imageProvider: FileImage(imageFile),
              initialScale: .40,
              maxScale: 1.75,
              minScale: .40,
              backgroundDecoration: BoxDecoration(
                color: Colors.white,
              ),
            ),
          );
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  native_pdf_view: ^1.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:native_pdf_view/native_pdf_view.dart';
  
Version Uploaded Documentation Archive
1.0.2 Feb 4, 2019 Go to the documentation of native_pdf_view 1.0.2 Download native_pdf_view 1.0.2 archive
1.0.1 Feb 4, 2019 Go to the documentation of native_pdf_view 1.0.1 Download native_pdf_view 1.0.1 archive
1.0.0 Feb 4, 2019 Go to the documentation of native_pdf_view 1.0.0 Download native_pdf_view 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
60
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
80
Learn more about scoring.

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

  • Dart: 2.1.0
  • pana: 0.12.13+1
  • Flutter: 1.2.1

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/pdf_renderer.dart. (-0.50 points)

Analysis of lib/pdf_renderer.dart reported 1 hint:

line 10 col 10: The class 'Future' was not exported from 'dart:core' until version 2.1, but this code is required to be able to run on earlier versions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
meta ^1.1.6 1.1.6 1.1.7
Transitive dependencies
collection 1.14.11
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8