Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webview in flutter not working getting a platform error

Issue with webview in flutter getting an error

[ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
    PlatformException(error, Trying to create a platform view of unregistered type: plugins.flutter.io/webview, null)

Trying to implement the webview getting the following error

like image 632
viveksuggu Avatar asked Apr 22 '19 12:04

viveksuggu


People also ask

How do I open URL in WebView in flutter?

Android-only settings: forceWebView – If set to null or false , the URL is opened in the device's default browser; otherwise, the URL is launched in a WebView. enableJavaScript – If set to true , JavaScript is enabled in WebView.


1 Answers

I had the same problem. But I did these steps, and it helped me:

1) Add Internet permission

<uses-permission android:name="android.permission.INTERNET" />

to the Android manifest: android/app/src/main/AndroidManifest.xml right above application tag.

2) Add this key:

<key>io.flutter.embedded_views_preview</key>
<string>YES</string>

in ios/Runner/Info.plist

3) Add full url (with http://www)

4) Call flutter clean, delete build folder.

like image 123
recvec Avatar answered Sep 30 '22 05:09

recvec