I am trying to display a web view in Flutter for Web but I got the following error :
PlatformException(Unregistered factory, No factory registered for viewtype 'plugins.flutter.io/webview', null)
Is there a way to display a WebView in Flutter Web ?
You need at first perform platformViewRegistry:
Look at that example. In that example old library was imported (on 29.09.19), but if you change 'flutter_web' on 'flutter' it have to work.
Also, you can use not only 'IFrameElement', it can be regular html:
Answer by @mohamed-salah is helpful, however, I was only getting a loading symbol on my screen. We need put
webview
insideWillPopScope
widget. Use the following code to properly loadwebview
-In
pubspec.yaml
add dependencyIn
StatefulWidget
class, use following code -you can use this package: https://pub.dev/packages/flutter_webview_plugin
and here is an working example you can use: