DEV Community

loading...
Cover image for Flutter PDF Viewer - Automated using GitHubActions

Flutter PDF Viewer - Automated using GitHubActions

rupanshichawda profile image Rupanshi Chawda ・1 min read

View PDF directly into your Flutter App using - flutter_plugin_pdf_viewer .

You can implement this using the flutter plugin and load a PDF directly into your Flutter App. It works offline too as it downloads the pdf and then loads it into the app.

My Workflow

The GitHub Action PDF_Flutter CI is designed to automate certain tasks for the developers making their life less complicated.

  • Configuring Flutter version
  • Installing dependencies
  • Run Test

Submission Category:

Maintainer Must-Haves and Wacky Wildcards

Yaml File and Link to Code

name: PDF_Flutter CI

# This workflow is triggered on pushes to the repository.

on:
  push:
    branches:
    - master

# on: push    # Default will running for every branch.

jobs:
  build:
    # This job will run on ubuntu virtual machine
    runs-on: ubuntu-latest
    steps:

    # Setup Java environment in order to build the Android app.
    - uses: actions/checkout@v1
    - uses: actions/setup-java@v1
      with:
        java-version: '12.x'

    # Setup the flutter environment.
    - uses: subosito/flutter-action@v1
      with:
        channel: 'stable' # 'dev', 'alpha', default to: 'stable'
        flutter-version: '1.17.5' # you can also specify exact version of flutter

    # Get flutter dependencies.
    - name: Install dependencies
      run: flutter pub get
    - name: run tests
      run: flutter pub run tests

Flutter PDF Viewer

View PDF directly into your Flutter App using -

flutter_plugin_pdf_viewer

Implementation -

You can implement this using the flutter plugin and load a PDF directly into your Flutter App. It works offline too as it downloads the pdf and then loads it into the app.

Additional Resources / Info

GitHub logo subosito / flutter-action

Flutter environment for use in actions. It works on Linux, Windows, and macOS.

flutter-action

This action sets up a flutter environment for use in actions. It works on Linux, Windows, and macOS.

Usage

steps
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
  with
    java-version: '12.x'
- uses: subosito/flutter-action@v1
  with
    flutter-version: '1.9.1+hotfix.6'
- run: flutter pub get
- run: flutter test
- run: flutter build apk

Build for iOS too (macOS only):

jobs:
  build:
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-java@v1
      with:
        java-version: '12.x'
    - uses: subosito/flutter-action@v1
      with:
        flutter-version: '1.9.1+hotfix.6'
    - run: flutter pub get
    - run: flutter test
    - run: flutter build apk
    - run: flutter build ios --release --no-codesign

Use app bundle, instead of APK:

steps
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
  with:
    java-version
Made with love by rupanshi-chawda

Discussion (0)

pic
Editor guide