YAHIYA MUHAMMED
YAHIYA MUHAMMED

Reputation: 3

i need to remove this text over flow in flutter. how can i do that?

I am facing error in the Text widget which is in Column.

  body: Padding(
    padding: const EdgeInsets.all(20),
    child: Column(
      mainAxisAlignment: MainAxisAlignment.spaceAround,
      children: [
        Row(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  widget.songModel.displayNameWOExt,  <------- here is my text
                ),
                Text(
                  widget.songModel.artist.toString(),
                  overflow: TextOverflow.fade,
                ),
              ],
            ),  
      ],
    ),   ), );

This is what happened to me

This is what i need look like

Upvotes: 0

Views: 88

Answers (3)

Rana sharjeel Ali
Rana sharjeel Ali

Reputation: 107

wrap the text with the container and give a specific size to the container after that use overflow: TextOverflow.fade or any other property of "overflow", because these properties only work when you give a size to textfield but you cant give size to textfield so wrap it with container.

Upvotes: 0

Chandramohan Kp
Chandramohan Kp

Reputation: 61

try embedding the Text() widget inside a Expanded() widget expanded documentation

Expanded is a widget that expands a child of a Row, Column, or Flex so that the child fills the available space.

Upvotes: 0

Gwhyyy
Gwhyyy

Reputation: 9196

Wrap the Text that is inside a Row widget with an Expanded widget:

Expanded(child: Text(/* Here the text*/),

Upvotes: 1

Related Questions