Skip to content

Commit 105c11c

Browse files
author
brandon.maness
committed
2 parents 6cfbe43 + ff4c987 commit 105c11c

18 files changed

+421
-200
lines changed

Diff for: .github/workflows/publish_pub.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish to pub.dev
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
container:
10+
image: google/dart:latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Setup credentials
14+
run: |
15+
mkdir -p ~/.pub-cache
16+
cat <<EOF > ~/.pub-cache/credentials.json
17+
{
18+
"accessToken":"${{ secrets.OAUTH_ACCESS_TOKEN }}",
19+
"refreshToken":"${{ secrets.OAUTH_REFRESH_TOKEN }}",
20+
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
21+
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
22+
"expiration": 1584628470088
23+
}
24+
EOF
25+
- name: Publish package
26+
run: pub publish -f

Diff for: .gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@
55
.pub/
66

77
build/
8+
example/ios/Flutter/flutter_export_environment.sh
9+
example/.flutter-plugins-dependencies
10+
android/.idea/

Diff for: CHANGELOG.md

+15-36
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,22 @@
1-
## 1.0.7
1+
# Changelog
22

3-
- Updated project to meet changed requirements by Flutter
4-
- Updated third-party dependencies
5-
- Fixes issue #21, #23
3+
## 1.1.2
4+
- Option to preload all pages in memory `PDFViewer(document: document,lazyLoad: false)`
65

7-
## 1.0.6
6+
## 1.1.1
7+
- Option to disable swipe navigation `PDFViewer(document: document,scrollDirection: Aixs.vertical)`
8+
- Option to change scroll axis to vertical or horizontal `PDFViewer(document: document,scrollDirection: Aixs.vertical)`
89

9-
- Fixed issue in 1.0.5 on iOS that caused xcode build to fail
10-
11-
## 1.0.5
12-
13-
- Fixed bug in iOS where due to caching of Flutter ImageProvider when switching documents old pages would persist
14-
- Added more cases in example demo
15-
16-
## 1.0.4
17-
18-
- Refactored PDFdocument.getAllPages() method (Thanks for @SergioBernal8 for PR )
19-
- Added white background to page (iOS)
20-
- Changed page resolution in iOS to 300 dpi
21-
- Moved tooltips to a proper class
22-
23-
## 1.0.3
24-
25-
- Added white background to page (Android)
26-
- Fixed cocoapods name
27-
- User can now define tooltips and page selection dialog strings
28-
- Tapping on page indicator now prompts to user to page selection dialog
29-
- Added zoom to PDFPage
30-
31-
## 1.0.2
32-
33-
- Bottom appbar no longer appears if PDF has only one page (Thanks for @markathomas for suggesting this )
34-
- Fixed opening PDF from assets not working.
35-
- Example now opens file from assets
10+
## 1.1.0
11+
- Removed rxdart dependency
12+
- Upgraded to androidX
13+
- Added support to optional header while loading document from url
14+
- Auto hide picker for 1 page documents
3615

3716
## 1.0.1
38-
39-
- Updated readme.md and added screenshots to package
17+
- Swipe control
18+
- Zoom scale up to 5.0
4019

4120
## 1.0.0
42-
43-
- Initial release
21+
- First upgraded version after fork
22+
- Cool new customization features

Diff for: README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# flutter_plugin_pdf_viewer
1+
# advance_pdf_viewer
22

3-
A flutter plugin for handling PDF files. Works on both Android & iOS
3+
A flutter plugin for handling PDF files. Works on both Android & iOS. Originally forked from (https://github.com/CrossPT/flutter_plugin_pdf_viewer).
44

55
## Installation
66

7-
Add *flutter_plugin_pdf_viewer* as a dependency in [your pubspec.yaml file](https://flutter.io/platform-plugins/).
7+
Add *advance_pdf_viewer* as a dependency in [your pubspec.yaml file](https://flutter.io/platform-plugins/).
88
```
9-
flutter_plugin_pdf_viewer: any
9+
advance_pdf_viewer: any
1010
```
1111

1212
---
@@ -57,7 +57,7 @@ Use the pre-built PDF Viewer
5757

5858
This code produces the following view:
5959

60-
<img height="500px" src="https://raw.githubusercontent.com/CrossPT/flutter_pdf_viewer/master/demo.png" alt="Demo Screenshot 1"/>
60+
<img height="500px" src="https://raw.githubusercontent.com/lohanidamodar/pdf_viewer/master/demo.png" alt="Demo Screenshot 1"/>
6161

6262
---
6363

@@ -66,7 +66,7 @@ This code produces the following view:
6666
* Allow password-protected files
6767
* ~~Refactor PDFDocument.getAll() method~~
6868
* ~~Increase page resolution~~
69-
* Add swipe to change page
69+
* ~~Add swipe to change page~~
7070

7171
---
7272

Diff for: android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ android {
2626

2727
defaultConfig {
2828
minSdkVersion 16
29-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
29+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3030
}
3131
lintOptions {
3232
disable 'InvalidPackage'

Diff for: android/gradle.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
android.enableJetifier=true
2+
android.useAndroidX=true
13
org.gradle.jvmargs=-Xmx1536M

Diff for: example/android/app/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ android {
3838
targetSdkVersion 28
3939
versionCode flutterVersionCode.toInteger()
4040
versionName flutterVersionName
41-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
41+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4242
}
4343

4444
buildTypes {
@@ -56,6 +56,6 @@ flutter {
5656

5757
dependencies {
5858
testImplementation 'junit:junit:4.12'
59-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
60-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
59+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
60+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
6161
}

Diff for: example/android/app/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
FlutterApplication and put your custom class here. -->
1111
<application
1212
android:name="io.flutter.app.FlutterApplication"
13-
android:label="flutter_plugin_pdf_viewer_example"
13+
android:label="pdf_viewer_example"
1414
android:icon="@mipmap/ic_launcher">
1515
<activity
1616
android:name=".MainActivity"

Diff for: example/android/gradle.properties

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
org.gradle.jvmargs=-Xmx1536M
2+
android.enableR8=true
3+
android.useAndroidX=true
4+
android.enableJetifier=true

Diff for: example/lib/main.dart

+45-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter_plugin_pdf_viewer/flutter_plugin_pdf_viewer.dart';
2+
import 'package:advance_pdf_viewer/advance_pdf_viewer.dart';
33

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

@@ -70,9 +70,50 @@ class _MyAppState extends State<MyApp> {
7070
title: const Text('FlutterPluginPDFViewer'),
7171
),
7272
body: Center(
73-
child: _isLoading
74-
? Center(child: CircularProgressIndicator())
75-
: PDFViewer(document: document)),
73+
child: _isLoading
74+
? Center(child: CircularProgressIndicator())
75+
: PDFViewer(
76+
document: document,
77+
//uncomment below line to preload all pages
78+
// lazyLoad: false,
79+
// uncomment below line to scroll vertically
80+
// scrollDirection: Axis.vertical,
81+
82+
//uncomment below code to replace bottom navigation with your own
83+
/* navigationBuilder:
84+
(context, page, totalPages, jumpToPage, animateToPage) {
85+
return ButtonBar(
86+
alignment: MainAxisAlignment.spaceEvenly,
87+
children: <Widget>[
88+
IconButton(
89+
icon: Icon(Icons.first_page),
90+
onPressed: () {
91+
jumpToPage()(page: 0);
92+
},
93+
),
94+
IconButton(
95+
icon: Icon(Icons.arrow_back),
96+
onPressed: () {
97+
animateToPage(page: page - 2);
98+
},
99+
),
100+
IconButton(
101+
icon: Icon(Icons.arrow_forward),
102+
onPressed: () {
103+
animateToPage(page: page);
104+
},
105+
),
106+
IconButton(
107+
icon: Icon(Icons.last_page),
108+
onPressed: () {
109+
jumpToPage(page: totalPages - 1);
110+
},
111+
),
112+
],
113+
);
114+
}, */
115+
),
116+
),
76117
),
77118
);
78119
}

0 commit comments

Comments
 (0)