Home > Net >  Flutter text inside row causing overflow error
Flutter text inside row causing overflow error

Time:05-28

Text simply dummy text of simply dummy text of simply dummy text of is causing error A RenderFlex overflowed by 201 pixels on the right.

This is screenshot of screen with error

Widget build(BuildContext context) {
  return Padding(
      padding: const EdgeInsets.all(16.0),
      child: Column(
        children: [
          Row(
            children: [
              Container(
                width: 110,
                height: 110,
                padding: EdgeInsets.all(8),
                child: Container(
                  child: Image.network(
                    "https://reedius.s3.ap-south-1.amazonaws.com/temp/Groceries-ThinkstockPhotos-836782690.jpeg",
                    fit: BoxFit.cover,
                  ),
                ),
              ),
              Column(
                children: [
                  Text(
                    'simply dummy text of  simply dummy text of  simply dummy text of  ',
                  ),
                  SizedBox(width: 100, child: TextField()),
                ],
              ),
            ],
          ),
        ],
      ));
}

CodePudding user response:

Try below code wrap your Column inside Expanded or Flexible

Padding(
      padding: const EdgeInsets.all(16.0),
      child: Column(
        children: [
          Row(
            children: [
              Container(
                width: 110,
                height: 110,
                padding: EdgeInsets.all(8),
                child: Container(
                  child: Image.network(
                    "https://reedius.s3.ap-south-1.amazonaws.com/temp/Groceries-ThinkstockPhotos-836782690.jpeg",
                    fit: BoxFit.cover,
                  ),
                ),
              ),
              Expanded(
                child: Column(
                  children: [
                    Text(
                      'simply dummy text of  simply dummy text of  simply dummy text of  ',
                      overflow: TextOverflow.ellipsis,
                    ),
                    SizedBox(width: 100, child: TextField()),
                  ],
                ),
              ),
            ],
          ),
        ],
      ),
    );
  • Related