AliAzad
AliAzad

Reputation: 263

Overflow problem inside of row. Fittedbox not worked

I have a Row inside that 4 other Rows and inside of the rows one icon and text. but when the text increases. I got the overflow problem.

I tried FittedBox and Flexible with fit property equal to FlexFit.loose not worked. enter image description here

this is my code

Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Icon(Icons.star, color: Color(0xFFf0b649)),
                                Text(
                                  "4.2",
                                  style: TextStyle(fontSize: 20),
                                )
                              ],
                            ),
                            Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Icon(Icons.remove_red_eye),
                                Text(
                                  "145",
                                  style: TextStyle(fontSize: 20),
                                )
                              ],
                            ),
                            Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Icon(Icons.people),
                                Text(
                                  "14766768675",
                                  style: TextStyle(fontSize: 20),
                                )
                              ],
                            ),
                            Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Icon(Icons.favorite_border),
                                Text(
                                  "دنبال کردن",
                                  style: TextStyle(fontSize: 15),
                                )
                              ],
                            ),
                          ]),

Upvotes: 0

Views: 1279

Answers (2)

Mr Random
Mr Random

Reputation: 2218

try Wrap() widget

A Wrap lays out each child and attempts to place the child adjacent to the previous child in the main axis, given by direction, leaving spacing space in between. If there is not enough space to fit the child, Wrap creates a new run adjacent to the existing children in the cross axis.

Upvotes: 0

VasilKanev
VasilKanev

Reputation: 1562

I had the same problem. Try wrapping the text widget with a column. If that doesn't work check this discussion enter link description here. I am quite sure that you find your answer there if the column wrap doesn't help. GL :)

Upvotes: 1

Related Questions