-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Open
Description
Steps to reproduce
- Run code below on Dart Pad
- Change size of the window like in the video attached.
Expected results
The texts AAA, BBB and CCC must be drawn consecutively without any strange line breaks.
Actual results
After reducing window size, a strange line appear between AAA and BBB parts.
It seems like the WidgetSpan act like a single rectangle and because of that the TextSpan around cannot align correctly.
It could be interesting to have a solution (maybe it exist ?) to have a "multiline WidgetSpan with pixel perfect hit box".
Code sample
Code sample
This example is small to hide all useless decoration added to the WidgetSpan in my app.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: const Text.rich(
TextSpan(
children: [
TextSpan(text: 'AAA AAA AAA AAA '),
WidgetSpan(
child: Text(
'BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB ',
),
),
TextSpan(text: ' CCC CCC CCC CCC'),
],
),
),
),
),
);
}
}Screenshots or Video
Screenshots / Video demonstration
Alignement broken :
Enregistrement.de.l.ecran.2026-01-27.a.10.25.35.mov
Logs
Logs
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.29.3, on macOS 26.2 25C56 darwin-arm64, locale fr-FR) [2,0s]
• Flutter version 3.29.3 on channel stable at /Users/earminjon/fvm/versions/3.29.3
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ea121f8859 (10 months ago), 2025-04-11 19:10:07 +0000
• Engine revision cf56914b32
• Dart version 3.7.2
• DevTools version 2.42.3
• Pub download mirror https://artifactory.dt.renault.com/artifactory/api/pub/pub-ccx-irn76318
[✓] Chrome - develop for the web [90ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] IntelliJ IDEA Ultimate Edition (version 2025.3.2) [88ms]
• IntelliJ at /Users/earminjon/Applications/IntelliJ IDEA.app
• Flutter plugin version 89.0.0
• Dart plugin version 502.0.0
[✓] Connected device (3 available) [6,7s]
• macOS (desktop) • macos • darwin-arm64 • macOS 26.2 25C56 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 26.2 25C56 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 143.0.7499.193
[✓] Network resources [260ms]
• All expected network resources are available.Metadata
Metadata
Assignees
Labels
No labels
