Flutter Web view not loading in windows desktop application Flutter Web view not loading in windows desktop application dart dart

Flutter Web view not loading in windows desktop application


The webview_flutter plugin doesn't exist for Windows yet, and in fact isn't possible to write yet since PlatformView support isn't implemented for Windows. (As the documentation says: "there are currently few plugins that actually have desktop support".)

Currently if you want a web view in your application it would need to be in a separate window, and you would need to write a plugin that creates and managers that Windows and web view.


While waiting for the official support from Flutter team, you can use flutter-webview-windows package. It adds support for Windows webview on Flutter and can communicate between the webview and flutter app (more detail here).

final _controller = WebviewController();@overridevoid initState() {  super.initState();  _init();}void _init() async {  await _controller.initialize();  await _controller.loadUrl('https://flutter.dev');  if (!mounted) return;  setState(() {});}@overridevoid dispose() {  super.dispose();  _controller.dispose();}@overrideWidget build(BuildContext context) {  return Scaffold(    appBar: AppBar(title: const Text('Webview')),    body: _controller.value.isInitialized        ? Webview(_controller)        : const Text('Not Initialized'),  );}