João Abrantes
João Abrantes

Reputation: 4883

Flutter Web got really slow on Google Chrome Mac M1

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

Answers (2)

B14ck
B14ck

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

Jo&#227;o Abrantes
Jo&#227;o Abrantes

Reputation: 4883

Looks like building with html instead of canvaskit solves the problem. Don't know why.

Upvotes: 2

Related Questions