1
votes

When I use a wrap for listing some widgets I have some problems. Wrap automatically align-center its child widgets. How can I align-left if there is one widget on the row?

Wrappping Output - 1

enter image description here

Wrapping Output - 2

enter image description here

Wrap(
              crossAxisAlignment: WrapCrossAlignment.start,
              alignment: WrapAlignment.start,
              children: customAnnouncementLabels
                  .map(
                    (customAnnouncementLabel) => LabelChip(
                      text: customAnnouncementLabel.name,
                      color: customAnnouncementLabel.bgColor,
                      isDetailed: false,
                    ),
                  )
                  .toList(),
            ),
1
By default, the wrap layout is horizontal and both the children and the runs are aligned to the start which is aligned left..maybe your parent widgets makes it aligned center..kindly checkedRaine Dale Holgado
Thank you so much, I aligned parent widget and problem is solved :)Cihat Akkiraz

1 Answers

0
votes

Try it :

runAlignment: WrapAlignment.start