Inspired by Pdf_Viewer_Plugin 😇 Wrapped around AndroidPdfViewer on Android. 🙏🏼
pdf_flutter
on pubspec.yml
dependencies:
pdf_flutter: ^version
Add this on ios/Runner/info.plist
:
<key>io.flutter.embedded_views_preview</key>
<true/>
PDF.network(
'https://raw.githubusercontent.com/FlutterInThai/Dart-for-Flutter-Sheet-cheet/master/Dart-for-Flutter-Cheat-Sheet.pdf',
height: 500,
width: 300,
maxAndroidZoom: widget.maxAndroidZoom,
midAndroidZoom: widget.midAndroidZoom,
minAndroidZoom: widget.minAndroidZoom,
)
File fileName;
PDF.file(
fileName,
height: 200,
width: 100,
maxAndroidZoom: widget.maxAndroidZoom,
midAndroidZoom: widget.midAndroidZoom,
minAndroidZoom: widget.minAndroidZoom,
)
PDF.assets(
"assets/pdf/demo.pdf",
height: 200,
width: 100,
maxAndroidZoom: widget.maxAndroidZoom,
midAndroidZoom: widget.midAndroidZoom,
minAndroidZoom: widget.minAndroidZoom,
)
Here are the steps to fix:
1. Add proguard-rules.pro file if its not already there
2. Inside of the proguard-rules.pro file put this:
-keep class com.shockwave.**
-keepclassmembers class com.shockwave.** { *; }
3.In app/build.gradle add this:
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'