Home > Software design >  Proper text wrapping for right sided widget in a row
Proper text wrapping for right sided widget in a row

Time:11-03

I have a layout as follows:

enter image description here

Widget1 is aligned to the left, Widget2 and the text widget - to the right. How can I wrap the text with an ellipsis for example in case it doesn't fit into the row, as follows?

enter image description here

CodePudding user response:

you can wrap 'Text with property...' inside ExpandedWidget.

Row(
      children: [
        WidgetA(),
        WidgetB(),
        Expanded(
          child: Text("...."),
        )
      ],
    )

CodePudding user response:

add your Text widget inside Expanded

Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Expanded(
          child: Text('Atras'),
        ),
        Expanded(
          child: Text('Filtros offertos'),
        ),
        Expanded(
          child: Text('title'),
        ),
        Expanded(
          child: Text('titleasdas'),
        ),
        Expanded(
          child: Text('title'),
        ),
        Expanded(
          child: Text('titlesfsfsdf'),
        ),
      ],
    ),

Your result screen-> enter image description here

  • Related