DEV Community

Cover image for Flutter PDF Viewer - Automated using GitHubActions
Rupanshi Chawda
Rupanshi Chawda

Posted on

Flutter PDF Viewer - Automated using GitHubActions

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

Enter fullscreen mode Exit fullscreen mode

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@v2
- uses: actions/setup-java@v2
  with:
    distribution: 'zulu'
    java-version: '11'
- uses: subosito/flutter-action@v1
  with:
    flutter-version: '2.0.5'
- run: flutter pub get
- run: flutter test
Enter fullscreen mode Exit fullscreen mode

Use latest release for particular channel:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
  with:
    distribution: 'zulu'
    java-version: '11'
- uses: subosito/flutter-action@v1
  with:
    channel: 'stable' # or: 'beta', 'dev' or 'master'
- run: flutter pub get
- run: flutter test
- run: flutter build apk
Enter fullscreen mode Exit fullscreen mode

Use latest release for particular version and/or channel:

steps
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
  with:
    distribution: 'zulu
Enter fullscreen mode Exit fullscreen mode
Made with love by rupanshi-chawda

Top comments (0)