Here i need two kind of alignment…
first column should occupy width based on its child’s maximum string length and next column should be align based on decimal..
Map<String,dynamic> map={
'FootBall':200.30,
'Hockey':3.30
'Golf':30.400
};
and here is code
Container(
color: Colors.grey,
height: 200,
width: 300,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children:
map.keys.map((e) => Row(
children: [
Text(e.toString()),
SizedBox(width: 10,),
Text(map[e].toString()),
],)).toList()
,),
)
I need following way alignment
FootBall : 200.30
Hockey : 3.30
Golf : 30.400
2
Answers
You can do like this
You can achieve it like this
You just have to set a
fixed width
to your text widget by wrapping them fromSizedBox
It looks like this