EDIT 5/28/2020: Not sure when exactly this was fixed, but as of Flutter 1.17.0, I no longer have this problem.
I've been trying to implement an iframe in Flutter WebView that requires WebGL (it displays a 3d model).
However, I get a warning saying WebGL in my browser is supported but not enabled. Here's a snippet for getting to https://get.webgl.org
:
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
class ModelView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Model View'),
),
body: Container(
child: WebView(
initialUrl: 'https://get.webgl.org',
javascriptMode: JavascriptMode.unrestricted,
),
),
);
}
}
Which displays:
Is there a way to enable WebGL for WebView
? Or is it impossible right now?
webview_flutter
on Android uses Platform Views to embed Android WebView while WKWebView is used on iOS. Both have WebGL support so displaying https://get.webgl.org/ should work fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With