skip to Main Content

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

3

Answers


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

    Expanded(child: Text(/* Here the text*/),
    
    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search