Flutter: How to Fix "A Renderflex Overflowed by Pixels " Error

flutter error: A RenderFlex overflowed by 1088 pixels on the right

Wrap your widget inside Expanded or Flexible:

Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.network(
'https://miro.medium.com/max/1400/1*-6WdIcd88w3pfphHOYln3Q.png',
width: 100,
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
' {widget.eventsListDetails[index][ name ]}',
),
Text(
" {widget.eventsListDetails[index]['description']}{widget.eventsListDetails[index]['description']}{widget.eventsListDetails[index]['description']}{widget.eventsListDetails[index]['description']}",
overflow: TextOverflow.ellipsis,
maxLines: 3,
),
],
),
),
],
),

Your Result screen-> Sample Image

Try to add your Inside Row widgets, wrap it with Expanded or Flexible Refer my answer here or here or here

how to fix A RenderFlex overflowed by 99889 pixels on the right?

If you read further into your error, you will most likely see a note mentioning that 'leading' takes up its maximum space. Change it to this:

leading: SizedBox(width:MediaQuery.of(context).size.width *.020, 
child: Consumer(
builder: (ctx, product, _) => IconButton(
icon: Icon(product.isFavorite
? Icons.favorite
: Icons.favorite_border),
color: Theme.of(context).accentColor,
onPressed: () {
product.toggleFavorite();
},
),
),
),

A RenderFlex overflowed by 77 pixels on the right. error in flutter

just use Column and Row instead of using Transform

look below codes:

GridTile(
child: Title(
color: Colors.red,
child: Row(
children: [
Image.network(
items[index],
height: 100,
),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(
left: 15,
),
child: Text(
text[index],
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
Row(
children: [
IconButton(
icon: Icon(
Icons.star_border_purple500,
color: Colors.yellow,
),
onPressed: () {},
),
SizedBox(width: 5),
Text(reviews[index]),
SizedBox(width: 5),
Text(
price[index],
style: TextStyle(
color: Colors.purple,
fontSize: 15,
),
),
],
),
Container(
margin: EdgeInsets.only(left: 15),
child: Text(pie[index]),
),
],
),
],
),
),
),

A RenderFlex overflowed by 3.0 pixels on the right /Flutter

It's probably this part :

             Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.grey.withOpacity(0.5),
),
width: 75,
child: Row(
children: [
Icon(
Icons.access_time,
),
Text(
'45 min.',
overflow: TextOverflow.ellipsis,
softWrap: true,
style: GoogleFonts.poppins(
fontSize: 15.0,
fontWeight: FontWeight.w400,
),
),
],
),

You should not set the width of the container containing the Row.

             Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.grey.withOpacity(0.5),
),
child: Row(
children: [

A RenderFlex overflowed by 260 pixels on the bottom. - ListTile

Try below code hope its helpful to you. used Column and Rows Widget instead of ListTile

SingleChildScrollView(
padding: EdgeInsets.all(10),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Date"),
Text("5/11/2021"),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Token no"),
Text("36"),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Token Issuance Date"),
Text("2/11/2021"),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Token Issuance Time"),
Text("12:15:00 PM"),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Calling Place"),
Text("Desk 07"),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Total Fee"),
Text("PKR. 1,000/-"),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Advance"),
Text("PKR. 200/-"),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Remaining"),
Text("PKR. 800/-"),
],
),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Status"),
Text("Unattended"),
],
),
SizedBox(
height: 10,
),
],
),
);

Your result Screen -> Image

How to 'A RenderFlex overflowed by 61 pixels on the bottom.' on the top of the virtual Keyboard for android

  1. A quick solution would be to block the widgets inside the Scaffold to resize themselves when the keyboard opens but this way,

some widgets can be obscured by the keyboard

We can do this using the resizeToAvoidBottomInset property on the Scaffold widget.

Example:

 return Scaffold(
resizeToAvoidBottomInset: false, //new line
appBar: AppBar(
title: Text('Expenses Tracker'),
),
body: Column(
children: <Widget>[
...... // other widgets
],
),
);



  1. Another solution is to wrap the Column widget into a scrollable widget. A built-in widget provided by Flutter which works well is the SingleChildScrollView. This is the best solution to avoid the “Bottom overflowed” error when the keyboard opens.
 return Scaffold(
appBar: AppBar(
title: Text('Expenses Tracker'),
),
body: SingleChildScrollView( // wrap with a scrollable widget
child: Column(
children: <Widget>[
...... // other widgets
],
),
),
);


Related Topics



Leave a reply



Submit