My issue is that flutter breaks Text at non whitespace characters:
How can I tell flutter not to beak text at the "/" but only when it encounters a whitespace?
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: Scaffold(
body: Center(
child: Container(
width: 220.0,
child: Text(
'This should not break here x/y/z',
style: TextStyle(fontSize: 30.0),
),
),
),
),
);
}
}
I have been looking into packages like auto_size_text, but found nothing addressing this problem.
Edit:
Working with '\n' is not an option since the length of the text varies,but it always includes the three x/y/z characters divided by slashes at the end.
I would rather not calculate the size of the rendered text in advance to determine whether a newline should be included before x/y/z. That would seem a little heavy, since these are card titles contained in a ListView.
On the web there is no issue, there the text is only broken at whitespaces:
<!DOCTYPE html>
<html>
<body>
<div style="background-color: grey; height: 200px; width: 400px;">
<p style="font-size: 24.0pt;">
This should not break here x/y/z
</p>
</div>
</body>
</html>
