flutter_widget_from_html icon indicating copy to clipboard operation
flutter_widget_from_html copied to clipboard

After rendering with customWidgetBuilder, there was a line break

Open mcy-ma opened this issue 10 months ago • 1 comments

HtmlWidget( ''' Inline block level label content (mandatory no line breaks) Line level label content (automatic no line breaks) ''', customWidgetBuilder: (context) { print('element=============$context'); final document = parse(context.innerHtml);

   final tag = context.localName;
   final attributes = context.attributes;

   if (tag == 'span') {
     return
       Text(
         'Text content',
         softWrap: false,
       );
   }

   return null;
 },

);

mcy-ma avatar Mar 05 '25 01:03 mcy-ma

If you want to keep the new widget on the same line, it should be possible to wrap your Text widget inside a InlineCustomWidget.

daohoangson avatar Mar 05 '25 02:03 daohoangson