Reputation: 684
I am not able to separate two items with space so that first item appears at the start of row and second at the end of it.
Container(
margin: EdgeInsets.all(12.0),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.end,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
InkWell(
child: Text("Select your service",
style: profileValueTextStyle),
onTap: () {
print("-----" + result);
}),
Icon(Icons.close)
],
),),
I want to separate the text and close icon.
Upvotes: 0
Views: 1119
Reputation: 788
You should wrap your InkWell
into a Expanded Widget
:
Container(
margin: EdgeInsets.all(12.0),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.end,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded( //Here's the widget you need
InkWell(
child: Text("Select your service",
style: profileValueTextStyle),
onTap: () {
print("-----" + result);
}),
),
Icon(Icons.close)
],
),),
It's gonna "push" the Icon
to the end of the row.
Hope it's helps !!
Upvotes: 1