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

[QUESTION] how to make image not inline? #1419

Open
azeunkn0wn opened this issue May 4, 2024 · 1 comment
Open

[QUESTION] how to make image not inline? #1419

azeunkn0wn opened this issue May 4, 2024 · 1 comment
Labels

Comments

@azeunkn0wn
Copy link

azeunkn0wn commented May 4, 2024

How do you make an img not inline?
I used ImageExtension() and wrap the image widget with GestureDetection to add onLongPressed
I want the image to be at the bottom of the text or add a new line before the image.

image

Example code:

SelectionArea(
      child: Html(
        data: data,
        shrinkWrap: true,
        style: {
          "body": Style(
            padding: HtmlPaddings.zero,
            margin: Margins.zero,
            fontSize: FontSize(16),
          ),
          "p": Style(
            padding: HtmlPaddings.zero,
            margin: Margins.zero,
            fontSize: FontSize(16),
          ),
        },
        
        extensions: [
          ImageExtension(
            builder: (extensionContext) {
              final element = extensionContext.styledElement as ImageElement;
             
              return GestureDetector(
                onTap: (){
                  /// do stuff
                },
                onTap: (){
                  /// do other stuff
                },
                child: Image.network(
                  element.src,
                ),
              );
            },
          )
        ],
      ),
    );

PS: I have no HTML/CSS experience

@azeunkn0wn azeunkn0wn changed the title [QUESTION] [QUESTION] how to make image not inline? May 4, 2024
@gibahjoe
Copy link

gibahjoe commented Jul 3, 2024

use the style map to set the display to block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants