flutter_glove_box
flutter_glove_box copied to clipboard
[golden_toolkit] [flutter_web] Roboto font is added to FontManifest in release mode
When running the release build of a Flutter Web App, we didn't expect the dev_dependency golden_tookit
to be adding a Font dependency. Is this the expected behavior, or could we configure our application to behave differently? The goal is to download as less files as possible, especially files we will never use when running the app, like this one.
One option is to not include the tests inside the application package, and have a separate test project for golden tests. Downside is that we have to export internal Widgets we want to test.
FontManifest.json:
[
{
"family":"packages/golden_toolkit/Roboto",
"fonts":[
{
"asset":"packages/golden_toolkit/fonts/Roboto-Regular.ttf"
}
]
}
]
This behavior might be related to us configuring our pubspec.yaml like this:
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: false
Doing this, the build output reports following message:
Launching lib\main.dart on Chrome in debug mode...
package:golden_toolkit has `uses-material-design: true` set but the primary pubspec contains `uses-material-design: false`. If the application needs material icons, then `uses-material-design` must be set to true.
Waiting for connection from debug service on Chrome...
Interesting. I'll need to look into this. I would have thought that tree shaking would have kept the font from actually being shipped since it is a dev_dependency
Sorry for the delay here... I am finally looking into this. the "uses-material-design" property from golden_toolkit will be removed. It was there to assist in some internal tests, which can be moved out to our example package.
Need to give a bit more thought to the roboto font though. If we don't bundle it, every consuming package will need to bundle it themselves if they don't want the blocky Ahem font.
https://github.com/flutter/flutter/issues/79261
Hi, did you solve the problem? Thanks!
Same in release Android