Reputation: 4883
My flutter website got really slow on my Google Chrome (mac M1).
The console shows no errors, and I have tested on other browsers and desktops and it works fine.
It's hard to find the cause when there are no errors. Does anyone has an idea?
P.S. This is the website: https://polys.art . It only gets slow after connecting it to web3 by pressing connect wallet
which will reveal another UI.
Upvotes: 1
Views: 2114
Reputation: 71
To override the web renderer at runtime:
Build the app with the auto option.
Insert a <script> tag in web/index.html file before the main.dart.js script.
Set window.flutterWebRenderer to "canvaskit" or "html":
<script type="text/javascript">
let useHtml = // ...
if(useHtml) {
window.flutterWebRenderer = "html";
} else {
window.flutterWebRenderer = "canvaskit";
}
</script>
<script src="main.dart.js" type="application/javascript"></script>
Upvotes: 1
Reputation: 4883
Looks like building with html
instead of canvaskit
solves the problem. Don't know why.
Upvotes: 2