fluttercommunity / flutter_webview_plugin Goto Github PK
View Code? Open in Web Editor NEWCommunity WebView Plugin - Allows Flutter to communicate with a native WebView.
Home Page: https://pub.dev/packages/flutter_webview_plugin
License: Other
Community WebView Plugin - Allows Flutter to communicate with a native WebView.
Home Page: https://pub.dev/packages/flutter_webview_plugin
License: Other
Would it be possible to add a feature to know when the URL of the browser has changed?
Currently using Oauth2, if a http server is the redirect, some apps show a warning to the user that the credentials are being sent to an insecure server.
If https is used, then iOS throws an error loading the redirect url.
I tried to start the example on iOS. Following Error:
flutter_app_test/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'flutter_webview_plugin/FlutterWebviewPlugin.h' file not found #import <flutter_webview_plugin/FlutterWebviewPlugin.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Could not build the application for the simulator. Error launching application on iPhone X.
On Android it works fine.
Hello, I want to modify it myself, and then use it on my app, such as intercept URL and add request function, so I will push it to pub! OK? Thank you.
Do you know what that error means?
Here is the code I added. Same happens with full screen WebViewScaffold.
flutterWebviewPlugin.launch("http://www.cnn.com",
rect: new Rect.fromLTWH(
0.0, 0.0, MediaQuery.of(context).size.width, 300.0),
userAgent: kAndroidUserAgent);
I'm getting the following error while trying to use the webview on iOS (via the Simulator) which is crashing the app. It only seems to happen for some URLs. On Android everything works fine, but on iOS I'm able to get through the login prompt and oAuth acceptance pages, but then it crashes when it tries to navigate to the actual authenticated app.
Unsupported value: <FlutterError: 0x60800023b740> of type FlutterError
*** First throw call stack:
(
0 CoreFoundation 0x000000010dff51e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000010d68a031 objc_exception_throw + 48
2 CoreFoundation 0x000000010dffa472 +[NSException raise:format:arguments:] + 98
3 Foundation 0x000000010d12d652 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 Flutter 0x000000010b89a808 -[FlutterStandardWriter writeValue:] + 2091
5 Flutter 0x000000010b89ae52 -[FlutterStandardMethodCodec encodeMethodCall:] + 136
6 Flutter 0x000000010b8945dc -[FlutterMethodChannel invokeMethod:arguments:] + 58
7 flutter_webview_plugin 0x000000010d052b62 -[FlutterWebviewPlugin webView:didFailNav<…>
Lost connection to device.
hope your update.
Note: C:\Users\seragud\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_webview_plugin-0.0.9+1\android\src\main\java\com\flutter_webview_plugin\WebviewActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Please update the android gradle build to match
https://github.com/flutter/plugins/blob/master/packages/firebase_auth/android/build.gradle
When closing the Webview on IOS, the "onDestroy" event is not triggered.
See on the example, it should show a snackbar with "Webview Destroyed"
This code works:
flutterWebviewPlugin.launch("https://google.com");
This code, however,
flutterWebviewPlugin.launch("https://google.com",
rect: new Rect.fromLTRB(0.0, 0.0, 0.0, 0.0));
causes an exception. I tried with different rect settings, tried putting this code in different places - in initState(), in build(), in main.dart - with the same results:
E/flutter (27126): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter (27126): PlatformException(error, The specified child already has a parent. You must call removeView() on the child's parent first., null)
E/flutter (27126): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:547:7)
E/flutter (27126): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:279:18)
E/flutter (27126): <asynchronous suspension>
E/flutter (27126): #2 FlutterWebviewPlugin.launch (package:flutter_webview_plugin/src/base.dart:103:20)
E/flutter (27126): <asynchronous suspension>
E/flutter (27126): #3 _AboutViewState.build (package:rebelation/screens/about_view/about_view.dart:48:33)
E/flutter (27126): #4 StatefulElement.build (package:flutter/src/widgets/framework.dart:3713:27)
E/flutter (27126): #5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3625:15)
E/flutter (27126): #6 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
E/flutter (27126): #7 StatefulElement.update (package:flutter/src/widgets/framework.dart:3782:5)
E/flutter (27126): #8 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
E/flutter (27126): #9 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
E/flutter (27126): #10 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
E/flutter (27126): #11 StatelessElement.update (package:flutter/src/widgets/framework.dart:3685:5)
E/flutter (27126): #12 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
E/flutter (27126): #13 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4644:14)
E/flutter (27126): #14 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
E/flutter (27126): #15 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4644:14)
E/flutter (27126): #16 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
E/flutter (27126): #17 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4644:14)
E/flutter (27126): #18 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
E/flutter (27126): #19 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4644:14)
E/flutter (27126): #20 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
E/flutter (27126): #21 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
E/flutter (27126): #22 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
E/flutter (27126): #23 StatefulElement.update (package:flutter/src/widgets/framework.dart:3782:5)
E/flutter (27126): #24 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
E/flutter (27126): #25 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
E/flutter (27126): #26 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
E/flutter (27126): #27 StatelessElement.update (package:flutter/src/widgets/framework.dart:3685:5)
E/flutter (27126): #28 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
E/flutter (27126): #29 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
E/flutter (27126): #30 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
E/flutter (27126): #31 StatefulElement.update (package:flutter/src/widgets/framework.dart:3782:5)
E/flutter (27126): #32 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
E/flutter (27126): #33 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4644:14)
E/flutter (27126): #34 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
E/flutter (27126): #35 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
E/flutter (27126): #36 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
E/flutter (27126): #37 ProxyElement.update (package:flutter/src/widgets/framework.dart:3892:5)
E/flutter (27126): #38 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
E/flutter (27126): #39 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4644:14)
E/flutter (27126): #40 Element.updateChild (package:flutter/src/widgets/framework.dart:2682:15)
E/flutter (27126): #41 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3636:16)
E/flutter (27126): #42 Element.rebuild (package:flutter/src/widgets/framework.dart:3478:5)
E/flutter (27126): #43 StatefulElement.update (package:flutter/src/widgets/framework.dart:3782:5)
E/flutter (27126): #44 Element.
I mean when I launch url: 'https://flutter.io', it will have a callback to check url. Then I click to a link in this webview like: 'https://flutter.io/setup', it will have a callback to check url.
Something like: jQuery("#url_adress").change(function(url){ // Check url });
Is there any solutions to help me with it?
Thanks guys so much.
Serve html from the user's assets folder for instance?
Possibly related to this #23.
I hope to increase the way to get the title of the web page. Under normal circumstances, the appbar title should display the title of the page
iOS has webView:shouldStartLoadWithRequest:navigationType: which can be used to deny loading if you don't want to follow a URL.
One of the possible uses: This could be used to communicate some state from within the webview. You parse the request and deny loading so the current page stays the same.
iOS does not provide a back button like Android
we should be able to add a back arrow with a top bar with title using launch function
flutterWebviewPlugin.launch(url, backButton: true, title: "Page tile in top bar");
I wrote the example.
https://pub.dartlang.org/packages/flutter_webview_plugin#-example-tab-
I pushed "Open widget webview" button.
The example show log text onStateChanged: WebViewState.startLoad
and onStateChanged: WebViewState.finishLoad
in the bottom.
I pushed "Open widget webview" button again, but it didn't show log text again.
Why only once?
I just want to do is that call JS when WebviewScaffold's url finish.
I didn't find a headers to add!
On Android when navigating through websites I want to use the back button to go back a page. This is currently not possible, the webview will be closed. Is this intentional?
I use the example from the repository and can reproduce this behavior with the fullscreen and widget webview. I digged in the source code and it should be able to set the back button to go back in the webviews history first by setting a setOnKeyListener
on the webview (see here).
How is the behaviour on iOS? If I recall correctly, you swipe from left to right to go back a page in Safari. Is this currently possible?
For the Android part I can create a pull request to change the back button behaviour. Should it be configurable or always go back until we reach the end of the history before exiting the webview?
Hi, I've recently integrated this plugin into my working Flutter project and attempted to build a preview for Android (which seems to work fine), and iOS which returned an error of the following:
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/flutterprojects/myapp/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'flutter_webview_plugin/FlutterWebviewPlugin.h' file not found
#import <flutter_webview_plugin/FlutterWebviewPlugin.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
I could use some advice to know if the error I am seeing is by design on my part.
I want to print the HTML as a PDF.
I am using the HTML print plugin for flutter.
There is no method to ask for the HTML from the webview it seems ?
Is it possible to for example signing in with facebook and getting back the token and id?
On IOS the fullscreen param should hide the topBar with the "Done" button, currently it seems to hide the statusBar instead.
Maybe we can have 2 differents params to handle both cases.
Are there any plans to use SFSafariViewController
instead of UIWebView
? I've read here SFSafariViewController
is necessary in apps using OAuth 2 authorization. I think iOS apps not using SFSafariViewController
will be rejected in App Store.
I don't if there's something similar (a native web view showing the current url) in Android. I know I could show the url in the AppBar when using a WebviewScaffold
, but it's not the same.
Thank you in advance for your response!
I am having problem with starting web_view in android. I used flutter_facebook_connect which opens webview for facebook authentication. It works on iOS, however Android build seems to have problem. here is the build log.
Launching lib/main.dart on c5674b2c in debug mode...
Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
Built build/app/outputs/apk/app-debug.apk (27.2MB).
Installing build/app/outputs/apk/app.apk...
I/FlutterActivityDelegate(13525): onResume setting current activity to this
Syncing files to device c5674b2c...
D/skia (13525): [SkFontMgr Android Parser] '/system/etc/fonts.xml' could not be opened
D/skia (13525): [SkFontMgr Android Parser] '/vendor/etc/fallback_fonts.xml' could not be opened
E/MethodChannel#flutter_webview_plugin(13525): Failed to handle method call
E/MethodChannel#flutter_webview_plugin(13525): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.veda.roomFinder/com.flutter_webview_plugin.WebviewActivity}; have you declared this activity in your AndroidManifest.xml?
E/MethodChannel#flutter_webview_plugin(13525): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1556)
E/MethodChannel#flutter_webview_plugin(13525): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1431)
E/MethodChannel#flutter_webview_plugin(13525): at android.app.Activity.startActivityForResult(Activity.java:3429)
E/MethodChannel#flutter_webview_plugin(13525): at android.app.Activity.startActivityForResult(Activity.java:3390)
E/MethodChannel#flutter_webview_plugin(13525): at com.flutter_webview_plugin.FlutterWebviewPlugin.openUrl(FlutterWebviewPlugin.java:55)
E/MethodChannel#flutter_webview_plugin(13525): at com.flutter_webview_plugin.FlutterWebviewPlugin.onMethodCall(FlutterWebviewPlugin.java:36)
E/MethodChannel#flutter_webview_plugin(13525): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191)
E/MethodChannel#flutter_webview_plugin(13525): at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:128)
E/MethodChannel#flutter_webview_plugin(13525): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#flutter_webview_plugin(13525): at android.os.MessageQueue.next(MessageQueue.java:125)
E/MethodChannel#flutter_webview_plugin(13525): at android.os.Looper.loop(Looper.java:124)
E/MethodChannel#flutter_webview_plugin(13525): at android.app.ActivityThread.main(ActivityThread.java:4960)
E/MethodChannel#flutter_webview_plugin(13525): at java.lang.reflect.Method.invokeNative(Native Method)
E/MethodChannel#flutter_webview_plugin(13525): at java.lang.reflect.Method.invoke(Method.java:511)
E/MethodChannel#flutter_webview_plugin(13525): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
E/MethodChannel#flutter_webview_plugin(13525): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
E/MethodChannel#flutter_webview_plugin(13525): at dalvik.system.NativeStart.main(Native Method)
I/FlutterActivityDelegate(13525): onResume setting current activity to this
W/DynamiteModule(13525): Local module descriptor class for com.google.firebase.auth not found.
W/IInputConnectionWrapper(13525): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(13525): setComposingText on inactive InputConnection
While using Widget Webview, it is not possible to show AlertDialogs or SnackBars or ModalBottomSheets.
For instance, to show a snackbar, we'd either use Scaffold.of(context).showSnackBar(new SnackBar(...)...);
or the method below:
return new WebviewScaffold(
key: _webViewScaffoldKey,
userAgent: userAgentString,
url: _getSubjectUrl(value),
appBar: new StudentoAppBar(actions: <Widget>[
new IconButton(
icon: new Icon(Icons.file_download),
color: Colors.white,
onPressed: () {
_webViewScaffoldKey.currentState.showSnackBar(new SnackBar(
content: new Text("Sample text!"),
duration: new Duration(seconds: 5),
action: new SnackBarAction(
label: "CLICK ME",
onPressed: _clickedMe,
),
),);},
),
],),
withLocalStorage: true,
);
These give errors:
1)
I/flutter ( 4430): ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
I/flutter ( 4430): The following NoSuchMethodError was thrown while handling a gesture:
I/flutter ( 4430): The method 'showSnackBar' was called on null.
I/flutter ( 4430): Receiver: null
I/flutter ( 4430): Tried calling: showSnackBar(Instance of 'SnackBar')
I/flutter ( 4430):
and 2)
I/flutter ( 4430): ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
I/flutter ( 4430): The following assertion was thrown while handling a gesture:
I/flutter ( 4430): Scaffold.of() called with a context that does not contain a Scaffold.
I/flutter ( 4430): No Scaffold ancestor could be found starting from the context that was passed to Scaffold.of(). This
I/flutter ( 4430): usually happens when the context provided is from the same StatefulWidget as that whose build
I/flutter ( 4430): function actually creates the Scaffold widget being sought.
I/flutter ( 4430): There are several ways to avoid this problem. The simplest is to use a Builder to get a context that
I/flutter ( 4430): is "under" the Scaffold. For an example of this, please see the documentation for Scaffold.of():
I/flutter ( 4430): https://docs.flutter.io/flutter/material/Scaffold/of.html
I/flutter ( 4430): A more efficient solution is to split your build function into several widgets. This introduces a
I/flutter ( 4430): new context from which you can obtain the Scaffold. In this solution, you would have an outer widget
I/flutter ( 4430): that creates the Scaffold populated by instances of your new inner widgets, and then in these inner
I/flutter ( 4430): widgets you would use Scaffold.of().
I/flutter ( 4430): A less elegant but more expedient solution is assign a GlobalKey to the Scaffold, then use the
I/flutter ( 4430): key.currentState property to obtain the ScaffoldState rather than using the Scaffold.of() function.
I/flutter ( 4430): The context used was:
I/flutter ( 4430): Builder
I/flutter ( 4430):
I/flutter ( 4430): When the exception was thrown, this was the stack:
I/flutter ( 4430): #0 Scaffold.of (package:flutter/src/material/scaffold.dart:944:5)
But both do not work. As for AlertDialog it is displayed behind this scaffold. I think that this is because WebviewScaffold extends StatefulWidget instead of Scaffold. Please fix.
I want zoom content in webview with gestures. Is it possible?
Like the title, Can I open file .html in my app folder?
Thanks you so much,!!!!
Is it possible to add a navigation drawer widget ? The readme suggests that this is not possible but want to get an opinion on this.
The reason being that the navigation drawer is much smoother
English is normal, I got an error when I entered Chinese
english
new WebviewScaffold(
url: new Uri.dataFromString(
'<html><body>hello</body></html>',
mimeType: 'text/html')
.toString())
chinese
new WebviewScaffold(
url: new Uri.dataFromString(
'<html><body>你好</body></html>',
mimeType: 'text/html')
.toString())
Hope to get a reply
thanks
Hi!
How can I use the webview inline with other widgets?
Is there a way to load a URL for an HTML file in assets?
You can't set the AppBar when using launch(url)
and if you use the WebviewScaffold
you can't access cookies, attach listeners, ...
Would it be possible to add the ability to specify the appbar when launching?
An API that is getting popular in the React community is the so called “render prop”. Would that be possible in dart?
flutterWebviewPlugin.launch(
url,
appBar: (state) => new AppBar(...),
);
new WebviewScaffold(
url: "https://www.google.com",
appBar: (state) => new AppBar(
title: new Text(state.url),
),
)
state
could hold things like url
, host
, isSecure
but also functions like goBack()
, close()
, goTo(url)
. This would make it a lot easier to add functionality to the appbar buttons.
Is it possible to create an Auth0 wrapper with this plugin?
When I try to connect to any webpage, it works a few seconds and then it shuts down the webview screen.
This is log of the Flutter app:
I/cr_Ime ( 4929): ImeThread is enabled.
E/chromium( 4929): [ERROR:interface_registry.cc(104)] Failed to locate a binder for interface: autofill::mojom::PasswordManagerDriver
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
D/EGL_emulation( 4929): eglMakeCurrent: 0xb4e054e0: ver 2 0 (tinfo 0xa9b26410)
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/cr_BindingManager( 4929): Cannot call determinedVisibility() - never saw a connection for the pid: 4929
W/IInputConnectionWrapper( 4929): finishComposingText on inactive InputConnection
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
I/art ( 4929): Background partial concurrent mark sweep GC freed 12(352B) AllocSpace objects, 2(23MB) LOS objects, 11% free, 30MB/34MB, paused 13.058ms total 37.816ms
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
W/art ( 4929): Attempt to remove non-JNI local reference, dumping thread
D/EGL_emulation( 4929): eglCreateContext: 0x84a16f20: maj 2 min 0 rcv 2
D/EGL_emulation( 4929): eglMakeCurrent: 0x84a16f20: ver 2 0 (tinfo 0xa6fda500)
D/EGL_emulation( 4929): eglMakeCurrent: 0x84a16f20: ver 2 0 (tinfo 0xa6fda530)
D/EGL_emulation( 4929): eglMakeCurrent: 0xb4e054e0: ver 2 0 (tinfo 0xa9b26410)
D/EGL_emulation( 4929): eglMakeCurrent: 0xb4e054e0: ver 2 0 (tinfo 0xa9b26410)
D/EGL_emulation( 4929): eglMakeCurrent: 0xb4e054e0: ver 2 0 (tinfo 0xa9b26410)
D/EGL_emulation( 4929): eglMakeCurrent: 0xb4e078e0: ver 2 0 (tinfo 0x92d39e60)
Is this only some Android emulator-related stuff, or it doesn't works at all? The code of my app is the same as the code in example/lib/main.dart
folder of this project.
The same issue is on my phone, where it's also prints "Webview Destroyed".
Emulator: Pixel XL API 25 on Windows 10
My phone: Honor Holly, Android v4.4.2
Implementing the plugin as shown:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
routes: {
"/": (_) => new WebviewScaffold(
url: "http://wckethman.com/htree/my-app/www/index.html",
withJavascript: true,
)
},
);
}
}
This works fine but when clicking on tel: links "net::ERR_UNKNOWN_URL_SCHEME" thrown
Any suggestions?
I was wondering, if it is possible to get data from cookies, set in the web view, to the flutter application. My use case is a custom auth mechanism which works by authentication with google on server side and sending a cookie with the client credentials in a cookie to the frontend (in this case my flutter app). Is this possible with this plugin?
I saw both #7 and #8 and am not sure about this approach because of the cookie instead of a redirect url and query parameters.
flutter upgrade
flutter run --preview-dart-2
in the console you will see if complaining about hit test. did not look into it but just wanted to flag it here while i was working on this
From @GokulDharumar on March 12, 2018 19:28
URL: https://pub.dartlang.org/packages/flutter_webview_plugin
when i use PopupmenuButton with webviewscafold. the menus are not displayed on top of webview ... the webview kind of hides the menu
routes: {
"/": () => new MyHomePage(title: "Flutter WebView Demo"),
"/widget": () => new WebviewScaffold(
url: selectedUrl,
appBar: new AppBar(
title: new Text("Test"),
actions: <Widget>[
new PopupMenuButton<Choice>( // overflow menu
onSelected: _select,
itemBuilder: (BuildContext context) {
return choices.skip(0).map((Choice choice) {
return new PopupMenuItem<Choice>(
value: choice,
child: new Icon(choice.icon),
);
}).toList();
},
),
],
),
)
},
Copied from original issue: dart-lang/pub-dev#1095
If I lunch the webview in a rect in non fullscreen mode, how do I change the rect dimension without reload the page in webview? I want to do this when the user rotate the screen.
The default name "Your Company" which seems to have been used to fill out the template makes the actual wording of the license problematic.
Neither the name of Your Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
I am trying to have WebView in Flutter using WebviewScaffold widget.
I have installed flutter_webview_plugin: "^0.1.0+1"
but I am getting ERROR:
MissingPluginException(No implementation found for method close on channel flutter_webview_plugin)
.
.
.
MissingPluginException(No implementation found for method launch on channel flutter_webview_plugin)
.
.
.
Below is how my page looks like:
import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
class BulkProductUpdatePageRoute extends MaterialPageRoute {
BulkProductUpdatePageRoute():
super(builder: (BuildContext context) => new BulkProductUpdatePage());
}
class BulkProductUpdatePage extends StatefulWidget {
@override
_BulkProductUpdatePageState createState() => new _BulkProductUpdatePageState();
}
class _BulkProductUpdatePageState extends State<BulkProductUpdatePage> {
@override
Widget build(BuildContext context) {
return new WebviewScaffold(
appBar: new AppBar(
leading: new RetailAppBarLeading(),
title: new Text('Bulk Product Update'),
bottom: appBarBottom(
child: new Container(
child: new TextField(
decoration: new InputDecoration(
icon: new Icon(
Icons.search,
color: Colors.grey,
),
hideDivider: true,
hintText: 'Search Products'
),
),
padding: new EdgeInsets.only(
bottom: 5.0
),
),
),
),
url: 'https://pub.dartlang.org/packages/flutter_webview_plugin#-installing-tab-',
);
}
}
Hi, how can I open a file that is locally stored on the device? For example, if the file index.html is located inside my project's assets folder?
I load with url on ios:
http://liveole.com/livescore-detail/basel-manchester-city-results22646
error log:
Unsupported value: <FlutterError: 0x60c000031080> of type FlutterError
Hi,
Is there a way to use a WebviewScaffold with a drawer?
I revised WebviewScaffold like this.
class MyWebviewScaffold extends StatefulWidget {
final PreferredSizeWidget appBar;
final String url;
final bool withJavascript;
final bool clearCache;
final bool clearCookies;
final bool enableAppScheme;
final String userAgent;
final bool primary;
final List<Widget> persistentFooterButtons;
final Widget bottomNavigationBar;
final bool withZoom;
final Drawer drawer;
MyWebviewScaffold(
{Key key,
this.appBar,
@required this.url,
this.withJavascript,
this.clearCache,
this.clearCookies,
this.enableAppScheme,
this.userAgent,
this.primary: true,
this.persistentFooterButtons,
this.bottomNavigationBar,
this.withZoom,
this.drawer})
...
class _MyWebviewScaffoldState extends State<MyWebviewScaffold> {
...
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: widget.appBar,
persistentFooterButtons: widget.persistentFooterButtons,
bottomNavigationBar: widget.bottomNavigationBar,
body: new Center(child: new CircularProgressIndicator()),
drawer: widget.drawer,
);
}
When I tab a drawer button, the drawer appears behind the webview.
I set the elevation of the drawer as 10000, but it's not working.
I think this is related to the Rect class of the Dart UI package.
Is there another way to use a webview with a drawer?
First, thank you very much for this very nice plugin for flutter.
Next, i need your help because i am trying to implement payment system inside flutter_webview_plugin.
When i open the webview for example like this :
// close any open browser (happen on hot reload)
await flutterWebviewPlugin.close();
_isOpen = true;
// init server
_server = await _createServer();
_listenCode(_server);
// catch onDestroy event of WebView
flutterWebviewPlugin.onDestroy.first.then((_) {
_close();
});
flutterWebviewPlugin.onBackPressed.first.then((_) {
_close();
});
// launch url inside webview
flutterWebviewPlugin.launch(url,
clearCookies: !cookie, fullScreen: fullscreen);
It is working well and my user is redirect to flutter webview to my payment page.
But when i am on the payment page atos ask me to chose my credit card like this :
On the computer when i click on a card everything is working well and i am redirected to the next page but when i am inside the flutter webview nothing happened and the flutter console show :
D/AppTracker(13525): App Event: stop
I/zygote (13525): Do partial code cache collection, code=123KB, data=113KB
I/zygote (13525): After code cache collection, code=123KB, data=113KB
I/zygote (13525): Increasing code cache capacity to 512KB
E/BoostFramework(13525): BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
E/BoostFramework(13525): BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
D/AppTracker(13525): App Event: start
I/chromium(13525): [INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://sandbox-webkit.lemonway.fr will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: (0)
I/chromium(13525): [INFO:CONSOLE(0)] "The SSL certificate used to load resources from https://sandbox-webkit.lemonway.fr will be distrusted in the future. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.", source: https://sandbox-webkit.lemonway.fr/myapp/dev/?moneyInToken=123456789101112131415&lang=fr (0)
Do you have any ideas please ?
I want to display some custom html string instead of loading from a url. Is this possible today?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.