Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用customWidgetBuilder渲染后换行了 #1420

Closed
mcy-ma opened this issue Mar 3, 2025 · 4 comments
Closed

使用customWidgetBuilder渲染后换行了 #1420

mcy-ma opened this issue Mar 3, 2025 · 4 comments
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@mcy-ma
Copy link

mcy-ma commented Mar 3, 2025

HtmlWidget(
'''
内联块级标签内容(强制不换行)行内标签内容(自动不换行)
''',
customWidgetBuilder: (context) {
print('element=============$context');
final document = parse(context.innerHtml);
final element = document.getElementsByTagName('spantex');

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

       if (tag == 'span') {
         return
           Text(
             '文本内容',
             softWrap: false,
           );
       }

       return null;
     },
   );
@mcy-ma mcy-ma added the bug Something isn't working label Mar 3, 2025
@daohoangson
Copy link
Owner

Sorry, I don't speak Korean.

@mcy-ma
Copy link
Author

mcy-ma commented Mar 5, 2025

After rendering with customWidgetBuilder, there was a line break

@daohoangson
Copy link
Owner

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 daohoangson self-assigned this Mar 5, 2025
@daohoangson daohoangson added question Further information is requested and removed bug Something isn't working labels Mar 5, 2025
@daohoangson
Copy link
Owner

Ah, I just saw your new #1425. I will close this one.

@daohoangson daohoangson added duplicate This issue or pull request already exists and removed question Further information is requested labels Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants