Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to center only one element in a column of 5 elements in flutter

I have 5 elements in a Column, and I make them cross in start, and I need to add another element 'Text' in the center of the column, So How do I make my Text centered in the entire Column, and the rest elements to the right start?

like image 911
BatoulAlani Avatar asked Oct 27 '25 14:10

BatoulAlani


1 Answers

In column one element wrap with Align widget

Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text('in start'), 
            Align(alignment: Alignment.center, child: Row(children: [ Icon(), Text() ] )),
            Align(alignment: Alignment.center, child: Text("test")),
            Text("test"),
            Text("test"),
            Text("test"),
          ],
        ),

Ouput:

enter image description here

like image 191
Jahidul Islam Avatar answered Oct 30 '25 03:10

Jahidul Islam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!