Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Add multiple line in Row Widget

I have wrapped 3 Text in Row, but get exceptions. How can I make them displayed multiple line ?

 Row(children: [
     Text("this is text 1 bla bla bla"),
     Text("this is text 2 bla bla bla"),
     Text("this is text 3 bla bla bla"),
    ],),

Error

════════ Exception caught by rendering library ═════════════════════════════════
A RenderFlex overflowed by 26 pixels on the right.
The relevant error-causing widget was
Row

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can use Flexible to solve this

      Row(children: [
        Flexible(child: Text("this is text 1 bla bla bla")),
        Flexible(child: Text("this is text 2 bla bla bla")),
        Flexible(child: Text("this is text 3 bla bla bla")),
      ])

Or you can use Wrap to show as a grid

      Wrap(children: [
        Text("this is text 1 bla bla bla"),
        Text("this is text 2 bla bla bla"),
        Text("this is text 3 bla bla bla"),
      ])
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading