daohoangson / flutter_widget_from_html

Flutter package to render html as widgets that supports hyperlink, image, audio, video, iframe and many other tags.
https://pub.dev/packages/flutter_widget_from_html
MIT License
635 stars 235 forks source link

How to control maxline? #1210

Closed red-star25 closed 6 months ago

red-star25 commented 6 months ago

Steps to Reproduce

HTML `

Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up

` ```html ```
`HtmlWidget` configuration `HtmlWidget('
${widget.data?.content}
',),` ```dart ```
Tesing environment [✓] Flutter (Channel stable, 3.16.5, on macOS 14.2.1 23C71 darwin-x64, locale en-IN) • Flutter version 3.16.5 on channel stable at /Users/dhruv/Downloads/development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 78666c8dc5 (3 months ago), 2023-12-19 16:14:14 -0800 • Engine revision 3f3e560236 • Dart version 3.2.3 • DevTools version 2.28.4 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/dhruv/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15C500b • CocoaPods version 1.14.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2023.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) [✓] VS Code (version 1.85.1) • VS Code at /Users/dhruv/Downloads/Visual Studio Code.app/Contents • Flutter extension version 3.84.0 [✓] Connected device (3 available) • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 14 (API 34) (emulator) • macOS (desktop) • macos • darwin-x64 • macOS 14.2.1 23C71 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.109 [✓] Network resources • All expected network resources are available. • No issues found! ``` ```

Expected results

As max line is defined. HtmlWidget should show max line only and if its getting overflowed then ellipses the text

Actual results

HtmlWidget is not following the max-line rules even after defining the rules externally