Skip to content

[Flutter Web] Text overflow the background. #99794

@shushanfx

Description

@shushanfx

As I use Text widget with a background color, the text will overflow the background for long text content. Just like this.

image

The more text content, the bigger in overflow part.

Here is my Flutter version.

Engine • revision ab46186b24
Tools • Dart 2.16.1 • DevTools 2.9.2

My command:

flutter run --web-port=18001 -d chrome --web-renderer=html

And my code here.

var maxWidth = 235;
return Container(
      constraints: BoxConstraints(
        maxWidth: maxWidth.toDouble(),
      ),
      decoration: BoxDecoration(
        color: Colors.green[200],
        borderRadius: const BorderRadius.only(
                topRight: Radius.circular(0),
                topLeft: Radius.circular(10),
                bottomLeft: Radius.circular(10),
                bottomRight: Radius.circular(10)),
      ),
      child: Text(
        '您的问题我已经收到,稍后我看下,语音回复您。' * 20,
        style: const TextStyle(color: Colors.black, fontSize: 12),
      ),
      padding: const EdgeInsets.only(top: 8, left: 10, right: 10, bottom: 15),
    );

Metadata

Metadata

Assignees

Labels

a: typographyText rendering, possibly libtxte: web_htmlHTML rendering backend for Webengineflutter/engine related. See also e: labels.found in release: 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions