How can I create line breaks within a long Text widget?
For example, I am creating a biographical page about myself. And I have three paragraphs I want to be able to display. But currently, I am outputting those paragraphs in one big Text Widget and the output does not have line breaks to differentiate the paragraphs. How can I do that?
This can be achieved by adding \n into your text widget as below. Here is the code from main. dart file to achieve this.
declare your text like so:
final String someText =
"stuff for the 1st paragraph\n\n"
"stuff for the 2nd paragraph\n\n"
"stuff for the 3rd paragraph\n\n";
and then you can just render it inside of a Text
widget like you normally would.
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