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
645 stars 242 forks source link

Still facing the issue -customWidgetBuilder builds text on newline #1319

Open aswathyMVP opened 3 months ago

aswathyMVP commented 3 months ago

Steps to Reproduce

customWidgetBuilder: (element) { if (element.localName == 'img') { final src = element.attributes['src'] ?? ''; if (src.endsWith('.svg')) { /// Return the custom SVG widget return SvgPictureNetwork(src); } else if (element.localName == 'svg') { // Handle inline SVG final svgString = element.outerHtml; return SvgPictureNetwork(svgString); } } // Return null for other elements to use default handling return null; },

HTML ```html ```
`HtmlWidget` configuration ```dart ```
Tesing environment ``` ```

Expected results

Actual results

aswathyMVP commented 3 months ago

https://github.com/daohoangson/flutter_widget_from_html/issues/779 Tried the solution mentioned but not worked

daohoangson commented 1 month ago

Have you tried wrapping your custom widget inside InlineCustomWidget?

vishal0768 commented 1 month ago

by using InlineCustomWidget we can make it inline, but I am getting one more issue on this, that is if i have custom widget in this who has inkwell, and if the custom widget comes at start of the sentence, it actually make it partially clickable for some reason. do you have any solution for this @daohoangson