
I wanted this here , there are 3 items in one Row
the first and second one is at top of that Row
while the last Icon
was at the center of that row vertically.
My approach was use of IntrinsicHeight
widget provider by flutter
Note : No any static height given in this solution
IntrinsicHeight(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
alignment: Alignment.topLeft,
child: Icon(
Icons.offline_bolt_sharp,
color: AppColors.secondary,
),
),
hSpacing(times: .5),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RichText(
text: TextSpan(
text: '',
style: TextStyle(),
children: <TextSpan>[
TextSpan(
text: "Free Delivery ",
style: TextStyle(
fontSize: 12,
color: AppColors.secondary,
fontWeight: FontWeight.bold,
),
recognizer: TapGestureRecognizer()
..onTap = () {}),
TextSpan(
text: "Tomorrow 5 Aug",
style: TextStyle(
fontSize: 12,
color: AppColors.secondary,
),
recognizer: TapGestureRecognizer()
..onTap = () {},
)
],
),
),
vSpacing(times: .5),
Text(
"On minimum spend of Rs ${commaNumber(3000)}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: AppColors.secondary,
),
),
],
),
),
Center(
child: Container(
child: Icon(
Icons.arrow_forward_ios_outlined,
size: 20,
color: AppColors.secondary,
),
),
),
],
),
))
This way you stretch all the element of Row
to equal height then position by alignment
property according to your need.