Open MyBuzzTechnologies opened 3 years ago
I have this exact issue as well.
please stable version.. after the flutter event
Same problem.
This is caused by https://github.com/flutter/flutter/issues/65940. auto_size_text checks TextPainter.didExceedMaxLines
to determine the right font size, but it's always returning false. The package is given the impression that the text always fits.
Could this be the reason that debugging in desktop chrome and changing to a smartphone aspect ratio resizes the text, but on a smartphone itself it doesn't?
Is there any workaround for this?
I'm facing the same issue, on desktop is all fine but when I compile and run on the smartphone it doesn't work
I have this exact issue as well.
Same here.
same here
A little hack if you have to deploy your web app (not a fix):
add this right after your
tag in your web/index.html:<script> window.flutterWebRenderer = 'canvaskit'; </script>
build using
flutter build web --web-renderer auto
It will force the web renderer to 'canvaskit'.
A little hack if you have to deploy your web app (not a fix):
- add this right after your tag in your web/index.html:
<script> window.flutterWebRenderer = 'canvaskit'; </script>
- build using
flutter build web --web-renderer auto
It will force the web renderer to 'canvaskit'.
You can actually just flutter build web --web-renderer canvaskit
. No need to modify your HTML.
@doppio I had to launch a little website on Firebase Hosting and doing just flutter build web --web-renderer canvaskit
did not work for me.
still same. In Flutter Web doesnt work properly
There's nothing the author of this package can do until https://github.com/flutter/flutter/issues/65940 is resolved, please thumbs-up that issue instead of "same here" comments so it gets prioritized by the Flutter team. 🙂
hello everyone, run: flutter build web --release --web-renderer html => auto_size_text not working. but, if run: flutter build web --release => working for me
It seems to be fixed in flutter 2.10.3! I've tried running my app on WEB using --web-renderer html and auto_size_text works as expected. Might need a little more testing, but I think we can close this issue now.
Just installed 2.10.4, doesn't seem to work with the html renderer for me.
It seems to be fixed in flutter 2.10.3! I've tried running my app on WEB using --web-renderer html and auto_size_text works as expected. Might need a little more testing, but I think we can close this issue now.
Just installed 2.10.4, doesn't seem to work with the html renderer for me.
Sorry I am using --web-renderer canvaskit. I don't know what happened to me that day
Any update on this? The problem is still there...
Create a simple app with AutoSizeText:
Widget build(BuildContext context) { return Container( // color: Colors.red, // child: const Center(child: Text("Reports")), child: Center( child: Container( width: 60, decoration: BoxDecoration(border: Border.all()), child: const AutoSizeText("Sample long text", minFontSize: 5, maxLines: 1), ))); }
Run with:
flutter -d chrome --web-renderer html
Note: the text does not resize correctly. If you run with --web-renderer canvasKit (the default for desktop) the text resizes correctly.
Flutter (Channel beta, 1.26.0-17.3.pre, on macOS 11.2.1 20D74 darwin-arm, locale en-GB) • Flutter version 1.26.0-17.3.pre • Framework revision 4b50ca7f7f (11 days ago) • Engine revision 2c527d6c7e • Dart version 2.12.0 (build 2.12.0-259.8.beta)
auto_size_text: ^2.1.0 (also tried 3.0.0-nullsafety.0 - same problem)
Reproducible on Chrome version 88.0.4324.150 (Official Build) (x86_64 translated)
Also has same problem on iPhone Safari browser (iOS 14.3)