Shahzain Ahmed
Shahzain Ahmed

Reputation: 93

RenderFlex overflowed email.toString() - Flutter

Whenever I am writing Text(email.toString()), it gives the error of RenderFlex overflowed, please help me how to fix it. I am using SharedPreferences.

Before writing Text(email.toString()) - it works fine

When writing Text(email.toString() - it gives error of RenderFlex overflowed

Upvotes: 0

Views: 73

Answers (2)

krunal Gajera
krunal Gajera

Reputation: 162

replace your Row with this one...

Row(
  children: [
    const Text("Email"),
    Expanded(
      child: Text(email.toString()),
    ),
  ],
),

Upvotes: 0

Ravindra S. Patil
Ravindra S. Patil

Reputation: 14865

Add your Text widget inside Expanded or Flexible widget, try below code:

Row(
  children: [
    Text('Email'),
    SizedBox(
      width: 10,
    ),
    Expanded(
      child: Text(
          '[email protected]@gmail.com'),
    ),
  ],
),

    

Result: image

Upvotes: 0

Related Questions