GithubHelp home page GithubHelp logo

rodydavis / easy_web_view Goto Github PK

View Code? Open in Web Editor NEW
174.0 174.0 94.0 19.12 MB

Flutter Web Views on Mobile and Web made easy!

Home Page: https://rodydavis.github.io/easy_web_view/

License: MIT License

Kotlin 0.11% Ruby 2.40% Swift 1.70% Objective-C 0.03% Dart 37.03% HTML 21.61% CMake 16.30% C++ 19.53% C 1.27%
flutter html markdown webview

easy_web_view's Introduction

Buy Me A Coffee Donate github pages GitHub stars easy_web_view

easy_web_view

Easy Web Views in Flutter on Web, Mobile and Desktop*!

  • Supports HTML Content or a Single Element
  • Supports Markdown Source
  • Supports convert to Flutter widgets
  • Supports remote download of url
  • Markdown -> Html
  • Html -> Markdown
  • Supports change in url
  • Selectable Text
  • Supports multiple views on the same screen if you provide a unique key

Online Demo: https://rodydavis.github.io/easy_web_view

Platforms

  • Web
  • Android
  • iOS
  • Windows

Getting Started

For Loading a new url or changing width/height just call setState!

 EasyWebView(
  src: src,
  isHtml: false, // Use Html syntax
  isMarkdown: false, // Use markdown syntax
  convertToWidgets: false, // Try to convert to flutter widgets
  // width: 100,
  // height: 100,
)

iOS/Android

Setup iOS Info.plist:

<key>io.flutter.embedded_views_preview</key>
<true/>

Windows

Follow setup: https://pub.dev/packages/webview_windows

Screenshots

easy_web_view's People

Contributors

ahmednfwela avatar kirill09 avatar martinjego avatar michaeldark avatar rodydavis avatar ronymesquita avatar sakutaro220 avatar sdabet-orpheo avatar slavap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

easy_web_view's Issues

Bug report about AutomaticKeepAliveClientMixin on web and backfrom Split Screen mod on Android

First thanks for your package,It's very useful for me.
I find some bugs in it.

  • When easywebview in a widget which build in a class which extend from AutomaticKeepAliveClientMixin , easywebview also reload everytime back from other view(widget).(But I'm not test orther plugin have this bug whether.)Only web,on Android work good.

  • backfrom Split Screen on Android sometimes report error from java,sometimes easywebview may disappear.

When disapper,console output:

E/InputMethodManager(23936): b/117267690: Failed to get fallback IMM with expected displayId=47 actual IMM#displayId=0 view=io.flutter.plugins.webviewflutter.InputAwareWebView{fd7a796 VFEDHVC.. ........ 0,0-1080,1411}
E/InputMethodManager(23936): b/117267690: Failed to get fallback IMM with expected displayId=49 actual IMM#displayId=0 view=io.flutter.plugins.webviewflutter.InputAwareWebView{fd7a796 VFEDHVC.. ........ 0,0-1080,469}
I/Presentation(23936): Presentation is being dismissed because the display metrics have changed since it was created.
E/InputMethodManager(23936): b/117267690: Failed to get fallback IMM with expected displayId=50 actual IMM#displayId=0 view=io.flutter.plugins.webviewflutter.InputAwareWebView{fd7a796 VFEDHVC.. ........ 0,0-1080,1411}

java report error not often
:)

Hope userful for you.

Flutter web finding a way to monitor the requested Url "navigationDelegate"

In the native webview there is a property called

    WebView(
                  initialUrl: widget.url,
                  javascriptMode: JavascriptMode.unrestricted,
                  navigationDelegate: (NavigationRequest request) async
                  {
                    if (request.url.startsWith('https://xxxxxx.xxx.xxx/'))
                    {
                      print('blocking navigation to ${request.url}');
                      _navigationService.navigateTo(UYUi.routeName,arguments: request.url);
                      return NavigationDecision.prevent;
                    }

            print('allowing navigation to $request');
            return NavigationDecision.navigate;
          },
        ) 

is there any way to monitor the requests like that in flutter web

Wrap height based on HTML content

Hello,
Thank you for the great library. I was looking for some library to display html on web (so ironic) xD. Then I came across this library.

I have a question about make the EasyWebView's height became wrap_content when rendering my HTML. Is this possible?

Thank you and have a nice day!

Bug: does not work with web-browsers (Chrome & Edge)

It runs fine on mobile (switches to mobile.dart in library). However, when executed on Chrome or Edge (web.dart is being called) nothing works anymore.

Error message

An Observatory debugger and profiler on Chrome is available at: http://127.0.0.1:51313/VRDXgP5Yj14=
Error: Unexpected null value.
at Object.throw_ [as throw] (http://localhost:51276/dart_sdk.js:5366:11)
at Object.nullCheck (http://localhost:51276/dart_sdk.js:5699:30)
at http://localhost:51276/packages/easy_web_view/src/impl.dart.lib.js:1179:19
at Object._checkAndCall (http://localhost:51276/dart_sdk.js:5576:16)
at Object.dcall (http://localhost:51276/dart_sdk.js:5581:17)
at http://localhost:51276/dart_sdk.js:171926:47
at IdentityMap.new.putIfAbsent (http://localhost:51276/dart_sdk.js:26765:21)
at _engine.PlatformViewManager.new.renderContent (http://localhost:51276/dart_sdk.js:171904:44)
at _engine.PlatformViewMessageHandler.new.[_createPlatformView] (http://localhost:51276/dart_sdk.js:171997:43)
at _engine.PlatformViewMessageHandler.new.handlePlatformViewCall (http://localhost:51276/dart_sdk.js:172016:36)
at _engine.EnginePlatformDispatcher..[_sendPlatformMessage] (http://localhost:51276/dart_sdk.js:171477:61)
at _engine.EnginePlatformDispatcher.
.sendPlatformMessage (http://localhost:51276/dart_sdk.js:171311:33)
at _DefaultBinaryMessenger.[_sendPlatformMessage] (http://localhost:51276/packages/flutter/src/services/system_channels.dart.lib.js:2179:38)
at _DefaultBinaryMessenger.send (http://localhost:51276/packages/flutter/src/services/system_channels.dart.lib.js:2223:40)
at MethodChannel._invokeMethod (http://localhost:51276/packages/flutter/src/services/system_channels.dart.lib.js:956:50)
at _invokeMethod.next ()
at runBody (http://localhost:51276/dart_sdk.js:39292:34)
at Object._async [as async] (http://localhost:51276/dart_sdk.js:39323:7)
at MethodChannel.[_invokeMethod] (http://localhost:51276/packages/flutter/src/services/system_channels.dart.lib.js:954:20)
at MethodChannel.invokeMethod (http://localhost:51276/packages/flutter/src/services/system_channels.dart.lib.js:968:33)
at platform_view$._HtmlElementViewController.new._initialize (http://localhost:51276/packages/flutter/src/widgets/platform_view.dart.lib.js:655:61)
at _initialize.next ()
at runBody (http://localhost:51276/dart_sdk.js:39292:34)
at Object._async [as async] (http://localhost:51276/dart_sdk.js:39323:7)
at platform_view$._HtmlElementViewController.new.[_initialize] (http://localhost:51276/packages/flutter/src/widgets/platform_view.dart.lib.js:653:20)
at platform_view$.HtmlElementView.new.[_createHtmlElementView] (http://localhost:51276/packages/flutter/src/widgets/platform_view.dart.lib.js:611:30)
at platform_view$._PlatformViewLinkState.new.[_initialize] (http://localhost:51276/packages/flutter/src/widgets/platform_view.dart.lib.js:1248:318)
at platform_view$._PlatformViewLinkState.new.initState (http://localhost:51276/packages/flutter/src/widgets/platform_view.dart.lib.js:1229:24)
at framework.StatefulElement.new.[_firstBuild] (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:54755:54)
at framework.StatefulElement.new.mount (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:31553:26)
at framework.StatelessElement.new.inflateWidget (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:30308:16)
at framework.StatelessElement.new.updateChild (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:30162:25)
at framework.StatelessElement.new.performRebuild (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:31589:31)
at framework.StatelessElement.new.rebuild (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:30660:12)
at framework.StatelessElement.new.[_firstBuild] (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:31557:12)
at framework.StatelessElement.new.mount (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:31553:26)
at framework.SingleChildRenderObjectElement.new.inflateWidget (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:30308:16)
at framework.SingleChildRenderObjectElement.new.updateChild (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:30162:25)
at framework.SingleChildRenderObjectElement.new.mount (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:47574:29)
at framework.SingleChildRenderObjectElement.new.inflateWidget (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:30308:16)
at framework.SingleChildRenderObjectElement.new.updateChild (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:30162:25)
at framework.SingleChildRenderObjectElement.new.mount (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:47574:29)
at framework.SingleChildRenderObjectElement.new.inflateWidget (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:30308:16)
at framework.SingleChildRenderObjectElement.new.updateChild (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:30162:25)
at framework.SingleChildRenderObjectElement.new.mount (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:47574:29)
at _LayoutBuilderElement.new.inflateWidget (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:30308:16)
at _LayoutBuilderElement.new.updateChild (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:30162:25)
at http://localhost:51276/packages/flutter/src/widgets/layout_builder.dart.lib.js:136:33
at framework.BuildOwner.new.buildScope (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:54201:13)
at _LayoutBuilderElement.new.[_layout] (http://localhost:51276/packages/flutter/src/widgets/layout_builder.dart.lib.js:119:36)
at http://localhost:51276/packages/flutter/src/rendering/layer.dart.lib.js:3224:11
at object$.PipelineOwner.new.[_enableMutationsToDirtySubtrees] (http://localhost:51276/packages/flutter/src/rendering/layer.dart.lib.js:6225:9)
at layout_builder._RenderLayoutBuilder.new.rebuildIfNecessary (http://localhost:51276/packages/flutter/src/widgets/layout_builder.dart.lib.js:243:16)
at layout_builder._RenderLayoutBuilder.new.performLayout (http://localhost:51276/packages/flutter/src/widgets/layout_builder.dart.lib.js:343:12)
at layout_builder._RenderLayoutBuilder.new.layout (http://localhost:51276/packages/flutter/src/rendering/layer.dart.lib.js:3187:14)
at view.RenderView.new.performLayout (http://localhost:51276/packages/flutter/src/rendering/layer.dart.lib.js:4672:58)
at object$.PipelineOwner.new.flushLayout (http://localhost:51276/packages/flutter/src/rendering/layer.dart.lib.js:6202:107)
at binding$5.WidgetsFlutterBinding.new.drawFrame (http://localhost:51276/packages/flutter/src/rendering/layer.dart.lib.js:5485:26)
at binding$5.WidgetsFlutterBinding.new.drawFrame (http://localhost:51276/packages/flutter/src/widgets/widget_span.dart.lib.js:56995:15)
at binding$5.WidgetsFlutterBinding.new.[_handlePersistentFrameCallback] (http://localhost:51276/packages/flutter/src/rendering/layer.dart.lib.js:5449:12)
at binding$5.WidgetsFlutterBinding.new.[_invokeFrameCallback] (http://localhost:51276/packages/flutter/src/scheduler/binding.dart.lib.js:762:9)
at binding$5.WidgetsFlutterBinding.new.handleDrawFrame (http://localhost:51276/packages/flutter/src/scheduler/binding.dart.lib.js:731:37)
at http://localhost:51276/packages/flutter/src/scheduler/binding.dart.lib.js:640:14
at internalCallback (http://localhost:51276/dart_sdk.js:25329:11)
The Flutter DevTools debugger and profiler on Chrome is available at: http://127.0.0.1:9101?uri=http%3A%2F%2F127.0.0.1%3A51313%2FVRDXgP5Yj14%3D
Application finished.

Flutter Doctor

[√] Flutter (Channel dev, 2.3.0-16.0.pre, on Microsoft Windows [Version 10.0.19043.985], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Enterprise 2019 16.10.0)
[√] Android Studio (version 4.2.0)
[√] IntelliJ IDEA Community Edition (version 2019.3)
[√] VS Code (version 1.56.2)
[√] Connected device (4 available)

• No issues found!

pubspec.yaml
name: myproject
description: A new Flutter project.
version: 1.0.0+1

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  easy_web_view: ^1.5.0

  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^1.0.0

flutter:
  uses-material-design: true

I created a new Flutter project from scratch using flutter create. For reproducibility:

main.dart
import 'package:flutter/material.dart';
import 'package:easy_web_view/easy_web_view.dart';

void main() {
  runApp(EasyWebView(
    onLoaded: () {},
    src: 'https://flutter.dev',
    isHtml: false, // Use Html syntax
    isMarkdown: false, // Use markdown syntax
    convertToWidgets: false, // Try to convert to flutter widgets
    // width: 100,
    // height: 100,
  ));
}

I understood that web-browsers depend on the packages dart:html and dart:ui (working example) whereas mobile devices are using the flutter webview package. This library is making use of that but the problem has to lay somewhere else.

Drawer does not respond when drawn over an EasyWebView

First of all, thanks for sharing, I've been straggling for days to show a page inside a Widget in iOS, Android and Web with the sane code base.
I use a Drawer in the AppBar, when it opens over an EasyWebView it stops responding.
Is there a way to solve this issue?
Thanks in advance.

Background color issue

Hi mate,
I am using easy web view lib. I face an issue is
I set the theme background as dark gray but when i open the Webview, it first show white color and until the web is loaded then it changes to default background color?
Could you support how to fix it ?

Getting Bad state: Future already completed in flutter web

Following is the exception raised when running on flutter web

══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════

The following StateError was thrown during a platform message response callback:

Bad state: Future already completed



When the exception was thrown, this was the stack:

dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 195:49  throw_

dart-sdk/lib/async/future_impl.dart 42:79                                     complete

packages/flutter/src/services/binding.dart 176:18                             <fn>

dart-sdk/lib/async/zone.dart 1192:38                                          _rootRunUnary

dart-sdk/lib/async/zone.dart 1085:19                                          runUnary

dart-sdk/lib/async/zone.dart 987:7                                            runUnaryGuarded

lib/_engine/engine/window.dart 331:23                                         <fn>

lib/_engine/engine/window.dart 488:17                                         <fn>

dart-sdk/lib/async/zone.dart 1192:38                                          _rootRunUnary

dart-sdk/lib/async/zone.dart 1085:19                                          runUnary

dart-sdk/lib/async/future_impl.dart 141:18                                    handleValue

dart-sdk/lib/async/future_impl.dart 682:44                                    handleValueCallback

dart-sdk/lib/async/future_impl.dart 711:32                                    _propagateToListeners

dart-sdk/lib/async/future_impl.dart 516:7                                     [_complete]

dart-sdk/lib/async/future.dart 315:15                                         <fn>

dart-sdk/lib/async/zone.dart 1180:38                                          _rootRun

dart-sdk/lib/async/zone.dart 1077:19                                          run

dart-sdk/lib/async/zone.dart 979:7                                            runGuarded

dart-sdk/lib/async/zone.dart 1019:23                                          <fn>

dart-sdk/lib/async/zone.dart 1184:13                                          _rootRun

dart-sdk/lib/async/zone.dart 1077:19                                          run

dart-sdk/lib/async/zone.dart 1003:23                                          <fn>

dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 50:19       internalCallback

════════════════════════════════════════════════════════════════════════════════════════════════════

How to access Iframe Id

Hi
How to access iframe id i am trying like this
var iFrame = html.document.querySelector('flt-platform-view').shadowRoot.querySelector('#testView');

but getting following error
invalid member on null: 'shadowRoot'

Not Compatible with Crashlytics

easy_web_view is using an old version of permission_handler and permission_handler_platform_interface that is causing conflicts with Crashyltics.

`Because permission_handler >=5.0.1+2 <5.1.0 depends on permission_handler_platform_interface 2.0.1 and permission_handler >=5.0.1 <=5.0.1+1 depends on permission_handler_platform_interface ^2.0.1, permission_handler >=5.0.1 <5.1.0 requires permission_handler_platform_interface ^2.0.1.

And because permission_handler ^5.1.0 depends on permission_handler_platform_interface ^2.0.2, permission_handler ^5.0.1 requires permission_handler_platform_interface ^2.0.1.

And because easy_web_view >=1.5.0 depends on permission_handler ^5.0.1+1 and permission_handler_platform_interface ^2.0.1 depends on plugin_platform_interface ^1.0.2, easy_web_view >=1.5.0 requires plugin_platform_interface ^1.0.2.

And because firebase_crashlytics_platform_interface 3.0.3 depends on plugin_platform_interface ^2.0.0 and no versions of firebase_crashlytics_platform_interface match >3.0.3 <4.0.0, easy_web_view >=1.5.0 is incompatible with firebase_crashlytics_platform_interface ^3.0.3.

And because firebase_crashlytics 2.0.3 depends on firebase_crashlytics_platform_interface ^3.0.3 and no versions of firebase_crashlytics match >2.0.3 <3.0.0, easy_web_view >=1.5.0 is incompatible with firebase_crashlytics ^2.0.3.

So, because ov_mobile depends on both firebase_crashlytics ^2.0.3 and easy_web_view ^1.5.0, version solving failed.
pub get failed (1; So, because ov_mobile depends on both firebase_crashlytics ^2.0.3 and easy_web_view ^1.5.0, version solving failed.)
exit code 1`

Listen for events

Is it planned to support event listeners for the content of the web view?
I am searching for a way to embed a website in a flutter (web) project and I need to access the currently displayed url of the widget.

E.g. wikipedia is embedded, the user clicks on a link, an event is fired that contains the new url.

Any callback if URL cannot be reached because of (say) no internet ?

Can we have an errorBuilder widget supplied to EasyWebView. This would be invoked if there was an exception launching the URL or URL could not be loaded etc ...

at the moment there is an onLoaded callback but this gets fired regardless of whether the URL could be accessed ....

Desktop support

Thank you for this awesome plugin.

It would be awesome to have desktop support with this plugin.
Are there plans to support Linux, Windows and MacOS?

Javascript player works in Chrome, but not mobile

I'm sure I'm doing something wrong, but I can't get EasyWebView to work in mobile (iOS or android) for a javascript video player. It will load a webpage (e.g. flutter.dev) fine but not the video player. Any ideas? Thanks!

`import 'dart:async';

import 'package:easy_web_view/easy_web_view.dart';
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

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

class MyApp extends StatefulWidget {
@OverRide
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State {
final Completer _controller =
Completer();

@OverRide
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
home: Scaffold(
appBar: AppBar(
title: Text('Material App Bar'),
),
body: Column(
children: [
Flexible(
child: EasyWebView(
src:
'http://dev.theinfiniteactuary.com/player3.php?lesson=35102',
// 'http://flutter.dev',
isHtml: false, // Use Html syntax
isMarkdown: false, // Use markdown syntax
convertToWidets: false, // Try to convert to flutter widget
),
),
// Flexible(child: Container()),
],
),
),
);
}
}`

Proper Html is not rendered

I am using this widget for loading the Html content.
EasyWebView(
convertToWidgets: true,
src:"


<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>



Thank you doctor 


we will follow as advised




",
isHtml: true,
isMarkdown: false, onLoaded: () {
},
),

This is my html String

<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
Thank you doctor 
we will follow as advised

The output is :
668ad5b3-063f-4636-92ca-b0fe0e555f62

The Output that i'm getting is showing the text
P {margin-top:0;margin-bottom:0;} Along with the output content.
Any Possibility to show the proper output

Unclear documentation

Hi, thanks for the package.
Could you please clarify the documentation and describe the parameters/options in more detail, that would be really helpful.

Crashes on launch

Can't get this plugin to work, I'm testing it on Android 10.

Code:

EasyWebView(
              src: 'https://github.com/',
              isHtml: false,
              isMarkdown: false, onLoaded: () { 
                print('loaded');
               },
              
            )

Error :

E/flutter ( 3200): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to create a platform view of unregistered type: plugins.flutter.io/webview
E/flutter ( 3200):      at io.flutter.plugin.platform.PlatformViewsController$1.createPlatformView(PlatformViewsController.java:97)
E/flutter ( 3200):      at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:95)
E/flutter ( 3200):      at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/flutter ( 3200):      at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:230)
E/flutter ( 3200):      at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/flutter ( 3200):      at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:658)
E/flutter ( 3200):      at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter ( 3200):      at android.os.MessageQueue.next(MessageQueue.java:336)
E/flutter ( 3200):      at android.os.Looper.loop(Looper.java:174)
E/flutter ( 3200):      at android.app.ActivityThread.main(ActivityThread.java:7397)
E/flutter ( 3200):      at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 3200):      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/flutter ( 3200):      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:919)
E/flutter ( 3200): , null)
E/flutter ( 3200): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:570:7)
E/flutter ( 3200): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:18)
E/flutter ( 3200): <asynchronous suspension>
E/flutter ( 3200): #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
E/flutter ( 3200): #3      AndroidViewController._create (package:flutter/src/services/platform_views.dart:634:54)
E/flutter ( 3200): #4      AndroidViewController.setSize (package:flutter/src/services/platform_views.dart:551:14)
E/flutter ( 3200): #5      RenderAndroidView._sizePlatformView (package:flutter/src/rendering/platform_view.dart:176:29)
E/flutter ( 3200): #6      RenderAndroidView.performResize (package:flutter/src/rendering/platform_view.dart:157:5)
E/flutter ( 3200): #7      RenderObject.layout (package:flutter/src/rendering/object.dart:1746:9)
E/flutter ( 3200): #8      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:13)
E/flutter ( 3200): #9      RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
E/flutter ( 3200): #10     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:13)
E/flutter ( 3200): #11     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
E/flutter ( 3200): #12     RenderConstrainedBox.performLayout (package:flutter/src/rendering/proxy_box.dart:268:13)
E/flutter ( 3200): #13     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
E/flutter ( 3200): #14     _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:299:13)
E/flutter ( 3200): #15     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
E/flutter ( 3200): #16     RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:207:11)
E/flutter ( 3200): #17     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
E/flutter ( 3200): #18     RenderPadding.performLayout (package:flutter/src/rendering/shifted_box.dart:207:11)
E/flutter ( 3200): #19     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
E/flutter ( 3200): #20     MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:171:11)
E/flutter ( 3200): #21     _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:480:7)
E/flutter ( 3200): #22     MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:240:7)
E/flutter ( 3200): #23     RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:399:14)
E/flutter ( 3200): #24     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
E/flutter ( 3200): #25     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:13)
E/flutter ( 3200): #26     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
E/flutter ( 3200): #27     RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:113:13)
E/flutter ( 3200): #28     _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1267:11)
E/flutter ( 3200): #29     RenderObject.layout (package:flutter/src/rendering/object.dart:1767:7)
E/flutter ( 3200): #30     RenderProxyBoxMixin.performLa

Can't scroll: `flutter run --dart-define=FLUTTER_WEB_USE_SKIA=true -d chrome` on Master channel

I have to run on channel Master and pass this --dart-define=FLUTTER_WEB_USE_SKIA=true. When I do, I can no longer scroll the html page. It displays but links don't work also.

I realize this might be beyond your interest, I'm just hoping you do know what to do.

I really like this package.

[✓] Flutter (Channel master, 1.25.0-5.0.pre.45, on macOS 11.0.1 20B29 darwin-x64, locale en-US)
    • Flutter version 1.25.0-5.0.pre.45 at /Users/bartonhammond/tools/flutter
    • Framework revision 81e1f7d1ed (20 hours ago), 2020-12-02 17:19:57 -0800
    • Engine revision 20caf54969
    • Dart version 2.12.0 (build 2.12.0-76.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/bartonhammond/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_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.1, Build version 12A7403
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /Users/bartonhammond/flutter/voiceClient/google-chrome-unsafe.sh

[✓] 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.51.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.16.0

[✓] Connected device (3 available)
    • iPhone SE (2nd generation) (mobile) • 5D61B4C3-F813-4E6D-BD30-D9A81F0C867C • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-1 (simulator)
    • Web Server (web)                    • web-server                           • web-javascript • Flutter Tools
    • Chrome (web)                        • chrome                               • web-javascript • Google Chrome 87.0.4280.88

• No issues found!

Track Src

Hi, I tried everything, to get the IframeElement source to be tracked.

The issue is that I have a callback URL, meaning when the IFrame eventually reaches the URL, the IFrame should pop.

Not able to scroll (Flutter Web, not sure if the same for Mobile)

Hi,

I'm not really sure if this is considered an issue, or a bug, but I was wondering if there was a reason, or a workaround for this.

When I have a EasyWebView displayed on a portion of the screen I am no longer able to click+drag on the WebView to scroll the screen, nor can I use the Touchpad to scroll if my mouse is hovering over the WebView.

I'm assuming this is because it is trying to scroll within the WebView, even though the WebView doesn't actually scroll.

Obviously the mouse, or my finger needs to interact with the WebView, but I can't figure out a way to enable both actions (interact with the WebView, and be able to scroll the page).

The only thing I can think of is having some sort of Widget over the top of the WebView, that disappears when clicked, but this probably isn't the most intuitive solution for users, and I also wouldn't know how to do this...

Any help or advice would be greatly appreciated

Flutter web rendering two or more easy_web_view fails

Hi there

When rendering two or more easy_web_view objects in the same screen (inside a column and the each one in a container) only loads successfully the last one.

Column(
      children: <Widget>[
      Container(
        child: EasyWebView(
        src: "https://www.latercera.com",
        onLoaded: () {

        },
        isHtml: false,
        isMarkdown: false,
        convertToWidgets: false,
        width: 300,       
         height: 180,
      )),
        Container(
            child: EasyWebView(
              src: "https://www.emol.com",    
              onLoaded: () {

              },

              isHtml: false,
              isMarkdown: false,
              convertToWidgets: false,
              width: 300,
              height: 180,
            )),
]),

Dependencies are out of date!

You're explicitly setting the semantic versioning numbers right down to the patch version number (updated when there's an error).
As it is, the permission_handler is way out of date. Hence, I can't use your easy_web_view library. Would like to try it.

  webview_flutter: ^2.0.2
  flutter_markdown: ^0.6.1
  markdown: ^4.0.0
  html2md: ^1.0.1
  url_launcher: ^6.0.3
  http: ^0.13.1
  permission_handler: ^5.0.1+1

With my own library packages, I forego the 'minor', and 'patch' numbers (set to zero) and just specify the 'major' semantic version number. Doing so, allows those dependencies to continue to 'update' with minor enhancements and bug fixes without you having to update your own library every time.

  webview_flutter: ^2.0.0
  flutter_markdown: ^0.6.0
  markdown: ^4.0.0
  html2md: ^1.0.0
  url_launcher: ^6.0.0
  http: ^0.13.0
  permission_handler: ^8.0.0

Disable right click

Hello and thanks for the library, is it possible to disable right click and any way possible to access the Inspect element?
Thanks

Are there callbacks for loading?

Hi, thanks for creating and sharing this useful stuff! I just wanna know if there are callbacks for loading status and failure? It's very useful for my app as it may loading some websites like facebook or twitter from countries where cannot access. Thanks in advance!

When drag html to the bottom , click back buttom need click two times.

First thanks for share .

Use easy_web_view in flutter web.

when I open the [url-page] and scroll down, then click back throw exception:[Uncaught Error: Assertion failed: org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/pointer_binding.dart:406:12
sanitizer != null]. click again [url-page] refresh, click again back to the last page.

`
import 'package:easy_web_view/easy_web_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_slife_health_web/common/constant/app_constant.dart';

class CompPdfView extends StatefulWidget {
String title;
String filePath;

CompPdfView({
this.title,
this.filePath,
});

@OverRide
_CompPdfViewState createState() => _CompPdfViewState();
}

class _CompPdfViewState extends State {
@OverRide
Widget build(BuildContext context) {

return WillPopScope(
  child: Scaffold(
    appBar: AppBar(
      centerTitle: AppConstant.default_center_title,
      title: Text(widget.title),
    ),
    body: EasyWebView(
      src: widget.filePath,
      isHtml: false, // Use Html syntax
      isMarkdown: false, // Use markdown syntax
      convertToWidets: false, // Try to convert to flutter widgets
    ),
  ),
  onWillPop: requestPop,
);

}

/// 点击退出按钮 - 直接退出当前页面
Future requestPop() {
print('###### 点击退出');
Navigator.pop(context);
return new Future.value(false);
}
}
`

Runtime warnings

../../flutter/.pub-cache/hosted/pub.dartlang.org/easy_web_view-1.4.0-nullsafety/lib/src/mobile.dart:83:9: Warning: Operand of null-aware operation '?.' has type 'EasyWebView' which excludes null.

  • 'EasyWebView' is from 'package:easy_web_view/src/mobile.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/easy_web_view-1.4.0-nullsafety/lib/src/mobile.dart').
    if (widget?.onLoaded != null) {
    ^
    ../../flutter/.pub-cache/hosted/pub.dartlang.org/easy_web_view-1.4.0-nullsafety/lib/src/mobile.dart:92:14: Warning: Operand of null-aware operation '?.' has type 'EasyWebView' which excludes null.
  • 'EasyWebView' is from 'package:easy_web_view/src/mobile.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/easy_web_view-1.4.0-nullsafety/lib/src/mobile.dart').
    width: widget?.width,
    ^
    ../../flutter/.pub-cache/hosted/pub.dartlang.org/easy_web_view-1.4.0-nullsafety/lib/src/mobile.dart:93:15: Warning: Operand of null-aware operation '?.' has type 'EasyWebView' which excludes null.
  • 'EasyWebView' is from 'package:easy_web_view/src/mobile.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/easy_web_view-1.4.0-nullsafety/lib/src/mobile.dart').
    height: widget?.height,
    ^
    ../../flutter/.pub-cache/hosted/pub.dartlang.org/easy_web_view-1.4.0-nullsafety/lib/src/mobile.dart:118:16: Warning: Operand of null-aware operation '?.' has type 'EasyWebView' which excludes null.
  • 'EasyWebView' is from 'package:easy_web_view/src/mobile.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/easy_web_view-1.4.0-nullsafety/lib/src/mobile.dart').
    key: widget?.key,
    ^
    ../../flutter/.pub-cache/hosted/pub.dartlang.org/easy_web_view-1.4.0-nullsafety/lib/src/mobile.dart:123:17: Warning: Operand of null-aware operation '?.' has type 'EasyWebView' which excludes null.
  • 'EasyWebView' is from 'package:easy_web_view/src/mobile.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/easy_web_view-1.4.0-nullsafety/lib/src/mobile.dart').
    if (widget?.onLoaded != null) {

how to run javaScript shell

i use the easy_web_view and it's so greate.but i want to do some javaScript shell in lauch url,how to do this? thanks

Crashing in android device

It's working fine in web but I am getting following error while running in android.

D/FlutterActivity(21082): Using the launch theme as normal theme.
D/FlutterActivityAndFragmentDelegate(21082): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate(21082): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
W/FlutterEngine(21082): Tried to automatically register plugins with FlutterEngine (io.flutter.embedding.engine.FlutterEngine@b51d0b3) but could not find and invoke the GeneratedPluginRegistrant.
D/FlutterActivityAndFragmentDelegate(21082): Attaching FlutterEngine to the Activity that owns this Fragment.
Error connecting to the service protocol: failed to connect to http://127.0.0.1:52633/DRbC1JREwNo=/

Unable to navigate in the dialog when easy_web_view renders a page

Hi ,

I have a flutter landing page from where i open few dialogs using showDialog (dialog.dart). In the landing page i am trying to load a section from external html using easy_web_view. Rendering looks fine and works like a charm. But If I open a dialog now i am unable to perform any actions inside the dialog. seems to be easy_web_view in on the top of the stack. Is there any way to come across this.

Regards,
Raveesha Joshi

CORS issue

Does the request made by browser?
I have a CORS issue and I suspect it due to the request does not contains the Origin in request, which should be filled up by browser.

event for web

On mobile, you can use 'event_name.postMessage(text)' to receive delivery. How do I fix this?

bug with use of stack.

Easywebview widget always on the font of the stack, therefore it overlap my widget within the stack so that i can't click the button even it is on the Easywebview widget.

[dependency error] plugin_platform_interface

Hello,
I tried to run example in your repo
Here are errors

C:\Users\ziun7\tmp\easy_web_view\example>flutter run -d chrome
Launching lib\main.dart on Chrome in debug mode...
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:plugin_platform_interface

For solutions, see https://dart.dev/go/unsound-null-safety
Unhandled exception:
Bad state: Unsupported Null Safety mode NonNullableByDefaultCompiledMode.Invalid, in null.
#0      ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:439:9)
#1      JavaScriptBundler.compile (package:frontend_server/src/javascript_bundle.dart:146:33)
#2      FrontendCompiler.writeJavascriptBundle (package:frontend_server/frontend_server.dart:638:47)
<asynchronous suspension>
#3      FrontendCompiler.compile (package:frontend_server/frontend_server.dart:549:9)
<asynchronous suspension>
#4      listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1119:11)
<asynchronous suspension>
the Dart compiler exited unexpectedly.
Waiting for connection from debug service on Chrome...             22.4s
Failed to compile application.

I found at pubspec.lock

  plugin_platform_interface:
    dependency: transitive
    description:
      name: plugin_platform_interface
      url: "https://pub.dartlang.org"
    source: hosted
    version: "1.0.3"

We should update to 2.0.0

https://pub.dev/packages/plugin_platform_interface/versions

image

WebView rebuilding/reloading inside of CustomScrollView

Hi, this WebView is great, it's the only one I've managed to get to work with Flutter-Web.

I'm having problems when using it inside of a CustomScrollView>SliverList and wondering if you could advise what to do? When I scroll the WebView widget will reload/rebuild, this doesn't happen when it's used inside of a SingleChildScrollView, so I guess it has something to do with widgets being destroyed... I've tried to stop this happening by using "automatickeepaliveclientmixin" on a Stateful widget but I didn't work. I'm pretty sure I was doing it correctly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.