auto_size_text
auto_size_text copied to clipboard
Support for Flutter Web
Is your feature request related to a problem? Please describe. Package doesn't work for flutter web. It's not compatible for flutter web projects.
Describe the solution you'd like Provide support for flutter web :)
Describe alternatives you've considered Decouple auto_size_text from flutter sdk.
Version
- Flutter version: v1.7.8+hotfix.3
- auto_size_text version: ^1.1.2
I'd love to support Flutter web but as long as it is not merged with Flutter, I think it will be hard to support both. How do you propose to decouple AutoSizeText
from the Flutter SDK?
Edit: Here is the corresponding Flutter bug
@leisim also ich hatte mir einige Packages angeschaut und die, die auch Flutter web unterstützen, basieren entweder nur auf Dart ohne Flutter Komponenten, oder Sie bieten neben Flutter Komponenten auch die Web-Version an. Ich vermute mal, dass diese als Dependecy flutter_web haben anstatt flutter.
Aber jetzt wo ich mir den Link angeschaut habe, denke ich warten wir lieber bis das Flutter Team das mal hinbekommt ^^ solange baue ich mal eine javascript Brücke. Kannst meinen Issue schließen, wenn du willst 👍
Ich lasse die issue offen und schließe sie sobald AutoSizeText
mit Flutter web funktioniert...
Alriiiight. I got it running for flutter web now 👍 . Instead of flutter, i imported flutter_web and just had to modify the pubspec.yaml in auto_size_text like this:
name: auto_size_text
description: Flutter widget that automatically resizes text to fit perfectly within its bounds.
version: 2.0.2+1
author: Simon Leier <[email protected]>
homepage: https://github.com/leisim/auto_size_text
environment:
sdk: ">=2.0.0 <3.0.0"
dependencies:
#flutter:
# sdk: flutter
flutter_web: any
flutter_web_ui: any
dev_dependencies:
#flutter_test:
# sdk: flutter
pedantic: '>=1.4.0 <3.0.0'
dependency_overrides:
flutter_web:
git:
url: https://github.com/flutter/flutter_web
path: packages/flutter_web
flutter_web_ui:
git:
url: https://github.com/flutter/flutter_web
path: packages/flutter_web_ui
flutter_web_test:
git:
url: https://github.com/flutter/flutter_web
path: packages/flutter_web_test
But for now the flutter_web Text Widget doesn't support "strutStyle". So i comment out the strutStyle and that's it! It works for flutter_web now 😄
I will fork that package and provide a web version 🤣
I'm happy to hear that no big changes are required. Feel free to create a pull request with the required changes once flutter_web is released 👍
done with Flutter 1.9 stable 👍🏼 you can close this issue 😊
I tried to run the AutoSizeText
demo and it looks really buggy. I'm not sure if it is a problem with Flutter but I'll leave this issue open until it really works.
But it works for my flutter web app ^^ I tested it with a demo app and mine, but great, to know, that you're really tracking that :) thx
It does not seem to work for me
on android
on web.
@Ahmadre what version or the package are you using?
@billy1380 I use the actual AutoSizeText version and Flutter: 1.12.* on master channel. did you set maxLines, and a TextStyle(fontSize:...)?
Gesendet von meinem Pixel 2 XL mit FastHub
auto_size_text works on web for dev channel @Ahmadre @leisim
For anyone wondering, mine was failing like @billy1380 's above until I removed overflow.elipsis.
auto_size_text does not work on beta channel
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