Home > Net >  Flutter Layouts
Flutter Layouts

Time:05-18

I am looking for a flutter layout where the children are in a row (children are of different sizes) and if the size available exceeds then the next children are placed in the next row. All of this should be dynamic. if the text is too big then it occupies the complete row and other texts go to the next one and so on. The text is already available in a list. Currently, I am using a grid view. builder, but if the text is too long it doesn't render it because of the cross-axis count. Can anybody help me out on this?

CodePudding user response:

U can Use Wrap widget It acts just like Row and its children will automatically go on next line/row if exceed width.

CodePudding user response:

Try Wrap() Widget

Example:

     Wrap(
        children: item.listTags!
            .map((e) => Container(
                padding: const EdgeInsets.all(10),
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(30),
                  color: Colors.amberAccent,
                ),
                child: Text(e.value),
              ),
            ).toList(),
      ),
  • Related