Skip to content

[BUG] Images extend beyond layout boundaries in flutter_html: ^3.0.0-beta.2 #1357

Closed
@hr1d0y

Description

@hr1d0y

Describe the bug:
The issue I'm facing is that the images within my HTML code are not fitting within the screen as they did in the past. When I attempted to implement the same feature again recently, I noticed that the images are no longer aligning correctly. What's happening now is that the images are extending beyond the designated container, causing only a portion of the image to be visible on the phone screen. This behaviour is different from what I experienced previously, and it's causing a disruption in the layout and presentation of the content. Attached screenshot below.

It used to work smoothly in Flutter 3.8, But after updating to 3.10 this problem appeared.

HTML to reproduce the issue:

Container(
            width: double.infinity,
            padding: EdgeInsets.symmetric(horizontal: Const.width),
            decoration: const BoxDecoration(),
            child: Html(
              data: Example["example"],
              shrinkWrap: true,
              style: {
                "*": Style(
                  fontFamily:
                      Functions.isBengaliTextPresent(example["example"])
                          ? Const.activeBengaliFont
                          : null,
                  fontSize: FontSize(DataFields.exampleFontSize.sp),
                  fontWeight: FontWeight.bold,
                ),
              },
            ),
          ),

Html widget configuration:
flutter_html: ^3.0.0-beta.2

Expected behavior:
The images within the HTML code should stay inside the designated container's padding, without extending beyond its boundaries.

Screenshots:

Before:
https://ibb.co/9h0GfRN

Now:
https://ibb.co/ngfzhpk

Device details and Flutter/Dart/flutter_html versions:
Device I checked in:
Oppo
Samsung
iTel
Symphony
Pixel 2

Package Version:
flutter_html: ^3.0.0-beta.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions