Here is a code:
import \'package:flutter/material.dart\';
void main() {
runApp(MaterialApp(home: Home()));
}
class Home extends StatelessWidget {
@override
Following the Github issue: Text overflow with ellipsis is weird and ugly by design
Here is a quick fix for it:
- The
TextOverflow.ellipsis
uses a regex pattern\u2026
, you can apply a regex pattern[\u{200B}
] on theText data
Code :
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
width: 200,
color: Colors.green[200],
child: Text(
'https://someurl.com/479247900828929846'.replaceAll("", "\u{200B}"),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
),
);
}
}
OUTPUT:
- Use the flutter package which gives you the ability to do this Assorted Layout Widgets