Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1320

Taking all the real remaining space in a row

$
0
0

I want to create a Row in Flutter with an avatar and some text. Currently, text is taking all remaining space horizontally with Expanded. I want to get rid of spacing on the left in the following example.

Note: Blue text "Atlas" is hardcoded. Rest of the content is coming from a database. You can think it's like a chat buble. Atlas is user name.

example_1

I've tried to use Stack but they are getting on top of each other that way which is not what I wanted. Is there any possible way to my Expanded take all space after the avatar vertically? Desired result is:

example_2

My current code is like this:

Row(    crossAxisAlignment: CrossAxisAlignment.start,    children: [      Container(        child: Container(          width: 45,          height: 45,          decoration: BoxDecoration(            borderRadius: BorderRadius.circular(50),          ),          child: Center(            child: Image.asset('image.png'),          ),        ),      context.smallGap,      Expanded(        child: Column(          crossAxisAlignment: CrossAxisAlignment.start,          children: [            Text('Atlas',            ),            Text('Rest of the text..',            ),          ],        ),      ),    ],  ),

Viewing all articles
Browse latest Browse all 1320

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>