-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: typographyText rendering, possibly libtxtText rendering, possibly libtxtfound in release: 3.7Found to occur in 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8Found to occur in 3.8frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
I'd expect wrapped Text to have an intrinsic size that fits the text. However, if I wrap such a text with an IntrinsicHeight
widget, the height includes the first line, only. If wrapped with an IntrinsicWidth
widget, on the other hand, the width does not only fit the text, but stretches to the available width.
Here is an example for "intrinsic height only includes the first line" (the yellow box should include all three lines):
class TestPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: IntrinsicHeight(
child: Container(
color: Colors.black12,
width: 105,
alignment: Alignment.centerLeft,
child: IntrinsicWidth(
child: Container(
color: Colors.yellow,
child: Text("Hallo! dies sollte umbrechen"),
),
),
),
),
),
);
}
}
Here is an example for "intrinsic width stretches to available width" (the yellow box should be left-aligned and stop at the "n" in the third line):
class TestPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
color: Colors.back12,
width: 105,
height: 105,
alignment: Alignment.centerLeft,
child: IntrinsicWidth(
child: Container(
color: Colors.yellow,
child: Text("Hallo! dies sollte umbrechen"),
),
),
),
),
);
}
}
My Flutter version:
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.1.10-pre.220, on Mac OS X 10.14.2 18C54, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.3)
[✓] VS Code (version 1.30.2)
[✓] Connected device (1 available)
GnafGnaf, JonasWanke, tomgilder, jolmiracle, arvid220u and 25 moretomgilder
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: typographyText rendering, possibly libtxtText rendering, possibly libtxtfound in release: 3.7Found to occur in 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8Found to occur in 3.8frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team