0

I am trying to build a vertical list of icons. I decided to use Wrap & Column widgets for that. However, the spacing between the icons is too big. I did use spacing, but it doesn't seem to help. Any thoughts on how I can make spacing smaller?

child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Padding( padding: const EdgeInsets.all(10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Container(child: Text('Title')), Container(child: Text('Category')), ], ), ), Wrap( direction: Axis.vertical, spacing: 1, runSpacing: 1, children: <Widget>[ IconButton( icon: Icon(Icons.check), iconSize: 14, onPressed: null, ), IconButton( icon: Icon(Icons.star_outline), iconSize: 14, onPressed: null, ), IconButton( icon: Icon(Icons.delete_outline), iconSize: 14, onPressed: () => deleteTx(tx.id), ), ], ), ], ) 

enter image description here

2 Answers 2

1

Yeah, you can

Just put 'em in containers and set to each height, for example - 20

Here your container with mods

Wrap( direction: Axis.vertical, spacing: 1, runSpacing: 1, children: <Widget>[ Container( height: 20, child: IconButton( icon: Icon(Icons.check), iconSize: 14, onPressed: null, ), ), Container( height: 20, child: IconButton( icon: Icon(Icons.star_outline), iconSize: 14, onPressed: null, ), ), Container( height: 20, child: IconButton( icon: Icon(Icons.delete_outline), iconSize: 14, onPressed: () {}, ), ), ], ), 
Sign up to request clarification or add additional context in comments.

1 Comment

but i advice to you read more about adaptive widgets such Flex, Flexible and others
0

You should provide a height for icons to space evenly in only that height. Try this.

Container( padding: EdgeInsets.all(10), height: 200, child: Card( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Container(width: 10,color: Colors.purple), Expanded( child: Padding( padding: const EdgeInsets.all(10.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Container(child: Text('Title')), Container(child: Text('Category')), ], ), ), ), Container( height: double.infinity, child: Wrap( crossAxisAlignment: WrapCrossAlignment.end, alignment: WrapAlignment.spaceBetween, direction: Axis.vertical, spacing: 1, runSpacing: 1, children: <Widget>[ IconButton( icon: Icon(Icons.check), iconSize: 14, onPressed: null, ), IconButton( icon: Icon(Icons.star_outline), iconSize: 14, onPressed: null, ), IconButton( icon: Icon(Icons.delete_outline), iconSize: 14, onPressed: null, ), ], ), ), ], ), ), ) 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.