flutter_login
flutter_login copied to clipboard
Unnecessary font downloads on the Web platform
Describe the bug
Using Cyricilic (possibly any non-ASCII) characters as LoginMessages.loginButton
(and likely any other AnimatedButton.text
) causes Flutter Web to download the fallback font Noto Sans SC.
The bug is caused by a TextStyle
which doesn't copy the fontFamily
from the theme here. For example, adding fontFamily: theme.textTheme.labelLarge!.fontFamily,
to the TextStyle
there resolves the issue for me, however in my opinion, it's wiser to use the whole theme.textTheme.labelLarge
for the style here.
To Reproduce Steps to reproduce the behavior:
- Run the gist on the Flutter Web platform.
- Go to the
Network
tab of the Chromium'sDeveloper Tools
. - Observe that both
Roboto
(the default font) andNoto Sans SC
(one of the fallback fonts) are downloaded.
Expected behavior
I expected only the Roboto
font to be downloaded.
Screenshots
Information (please complete the following information):
- Platform: web
- Flutter version: 3.24.1
- Package version: 5.0.0