I have the following widget that I use to print text:
class NormalText extends StatelessWidget {
final String txt;
NormalText(this.txt) {}
@override
Widget build(BuildContext context) {
return Container(
child: Text(txt,
style: TextStyle(
color: Colors.grey,
fontSize: 20,
fontWeight: FontWeight.bold)));
}
}
But if I use it like:
NormalText('hello\tworld\t42')
The \t indentation is too tiny. Is there any way to increase the indentation to take more space ?
If you still want to keep the space between the words, and only increase the tabs, you can use Wrap widget
Wrap(
children: "hello hello\tworld\t42"
.split("\t")
.map((text) => Text(text))
.expand((element) => [
element,
SizedBox(
width: 50,
)
])
.toList()
..removeLast(),
),
You can use wordSpacing parameter
Text(
'Build some widgets!',
style: TextStyle(
height: 1.2 ,
wordSpacing: 6,
letterSpacing: 1.0,
)
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With