daohoangson / flutter_widget_from_html

Flutter package to render html as widgets that supports hyperlink, image, audio, video, iframe and many other tags.
https://pub.dev/packages/flutter_widget_from_html
MIT License
626 stars 230 forks source link

Error render iframe from app desktop #562

Open tuantiensiu opened 3 years ago

tuantiensiu commented 3 years ago

Steps to Reproduce

HTML ```

```
`HtmlWidget` configuration ``` import 'package:canvas_lms/api.dart'; import 'package:canvas_lms/modal/DetailPage.dart'; import 'package:canvas_lms/modal/ModuleItems.dart'; import 'package:flutter/material.dart'; import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; class ModulePageDetail extends StatefulWidget { final String url; const ModulePageDetail({Key key, this.url}) : super(key: key); @override _ModulePageDetailState createState() => _ModulePageDetailState(); } class _ModulePageDetailState extends State { HttpService httpService = HttpService(); Future detailPage; @override void initState() { detailPage = httpService.getPageModule(widget.url); super.initState(); } @override Widget build(BuildContext context) { return FutureBuilder( future: detailPage, builder: (context, snapshot) { if (snapshot.hasData) { return Container( padding: EdgeInsets.all(10.0), child: HtmlWidget( "${snapshot.data.body}", webView: true, ), ); } else { return Center(child: CircularProgressIndicator()); } }, ); } } ```
Tesing environment ``` [✓] Flutter (Channel stable, 2.0.5, on Mac OS X 10.15.7 19H524 darwin-x64, locale en) • Flutter version 2.0.5 at /Users/mac/Documents/flutter • Framework revision adc687823a (4 months ago), 2021-04-16 09:40:20 -0700 • Engine revision b09f014e96 • Dart version 2.12.3 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/mac/Library/Android/sdk • Platform android-30, build-tools 30.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.2, Build version 12B45b • CocoaPods version 1.10.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) [✓] VS Code (version 1.59.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.25.0 [✓] Connected device (2 available) • macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.7 19H524 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.131 ```

Expected results

This error the sample both window and macOS Tux, the Linux mascot

Actual results

daohoangson commented 3 years ago

This is expected, PlatformView is not supported on desktop platforms yet so web view is not working. See https://github.com/flutter/flutter/issues/41722 for example.