Flutter_html: Right overflow on some devices

Created on 22 Jun 2020  路  5Comments  路  Source: Sub6Resources/flutter_html

There's a right overflow on some devices. Everything is fine on the emulator. This is on my Samsung Galaxy Note 8 running Android 10.

Screenshot_20200622-172639

Most helpful comment

If ignoring accessibility is not a problem you can try a workaround like:

`MediaQuery(

    data: MediaQuery.of(context).copyWith(textScaleFactor: 1),
    child: Html(
      data: someHtmlText,
      shrinkWrap: true,
      style: {"body": Style(
        fontSize: FontSize(18,),
        color: someColor,
        textAlign: TextAlign.center,
      )},
    ),
  )

`

All 5 comments

See #308 and fix #333 - this is (mostly) due to a bug in Flutter.

I've also created a branch with a solution to it. Mostly the same as @edwardaux solution to #333 but with the ability to define textScaleFactor for the whole HTML widget.

If ignoring accessibility is not a problem you can try a workaround like:

`MediaQuery(

    data: MediaQuery.of(context).copyWith(textScaleFactor: 1),
    child: Html(
      data: someHtmlText,
      shrinkWrap: true,
      style: {"body": Style(
        fontSize: FontSize(18,),
        color: someColor,
        textAlign: TextAlign.center,
      )},
    ),
  )

`

See #308 and fix #333 - this is (mostly) due to a bug in Flutter.

333 sadly does not fix this issue.

@ueman #333 doesn't fix the issue due to a Flutter issue that is unresolved. Text is not wrapping correctly.

I will close this issue as it is a duplicate of #308, and we are unable to fix this until Flutter fixes it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AbdoXLabs picture AbdoXLabs  路  5Comments

a-href picture a-href  路  4Comments

DrobyshevAlex picture DrobyshevAlex  路  3Comments

Felix010203 picture Felix010203  路  4Comments

bhanuka96 picture bhanuka96  路  4Comments