Closed szepeshazi closed 2 years ago
Please try flutter_html 3, which is in alpha. This has been modularised for exactly this purpose (among others). You can (in fact have to) opt in for features such as math support (where all the fonts are coming from).
Please try flutter_html 3, which is in alpha. This has been modularised for exactly this purpose (among others). You can (in fact have to) opt in for features such as math support (where all the fonts are coming from).
Excellent news! Will do so. Thanks for this.
Describe the bug:
When comparing a minimal MaterialApp containing a single Text child node, and a MaterialApp containing a single Html node, the total size of the web application increases significantly.
To test, build the below minimal applications with
flutter build web --release
command (used Win11 x64 for building).First app, without
flutter_html
main.dart.js
size: 1.26MbNetwork traffic when loading the app:
Second app, with
flutter_html
main.dart.js
size: 2.77Mb (size increase: 1.51Mb)Network traffic when loading the app:
Expected behavior:
main.dart.js
size should not increase to more than double, when using a html widget containing a single node. Also, the application should not load eagerly many fonts that will not be used during rendering (see screenshot).Screenshots:
Device details and Flutter/Dart/
flutter_html
versions:flutter_html:
A picture of a cute animal (not mandatory but encouraged)