flutter_pdfview
flutter_pdfview copied to clipboard
Support MacOS Platform (Flutter Desktop)
Summary
Plugin does not seem to support desktop applications, such as TargetPlatform.macOS, when running flutter run -d macos.
I understand this might be an issue in Flutter, and not this plugin itself. However, there might be a workaround while Flutter does not officially support it.
Code
When the code below is called:
body: Stack(
children: <Widget>[
PDFView(
filePath: widget.path,
onError: print,
),
],
),
The following message is print on screen:
TargetPlatform.macOS is not yet supported by the webview_flutter plugin
Flutter Doctor
[✓] Flutter (Channel dev, 1.20.0-1.0.pre, on Mac OS X 10.15.5 19F101, locale pt-BR)
• Flutter version 1.20.0-1.0.pre at /Applications/flutter
• Framework revision f73f498da1 (12 days ago), 2020-06-18 08:23:22 -0700
• Engine revision c0d52b98d1
• Dart version 2.9.0 (build 2.9.0-16.0.dev 2b917f5b6a)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/eduardosorensen/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.8.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 43.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] VS Code (version 1.46.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.12.1
[✓] Connected device (4 available)
• iPhone SE (2nd generation) • 3BBA6D54-36B7-4F94-8DB4-3AD57C749C93 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
• macOS • macOS • darwin-x64 • Mac OS X 10.15.5 19F101
• Web Server • web-server • web-javascript • Flutter Tools
• Chrome • chrome • web-javascript • Google Chrome 83.0.4103.116
• No issues found!
@isorensen Hello, thanks for trying.
This plugin works only iOS & android right now. I'll implement soon other platforms including desktops and web. Get in touch. Thanks.