I have OutlinedButton with Row inside it with Icons on left and right and text between them.
and how it's implemented in code:
Container(
width: size.width * 0.4,
child: OutlinedButton(
onPressed: () {
},
style: OutlinedButton.styleFrom(
side: BorderSide(
color: Color(0xFF44A5FF)
)
),
child: Container(
width: size.width * 0.4,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Icon(Icons.star_outline, color: Color(0xFF44A5FF)),
Container(
width: (size.width * 0.3) * 0.6,
child: AutoSizeText(
selectedValue!,
style: TextStyle(
color: Color(0xFF44A5FF),
fontWeight: FontWeight.w400
),
maxLines: 1,
minFontSize: 8,
),
),
Icon(
Icons.keyboard_arrow_down_sharp,
color: Color(0xFF44A5FF),
),
],
),
),
),
),
I want to set these icons closer to start and end of OutlinedButton and I don't know how to achieve that.
You can provide padding
on style
, it will reduce some padding
style: OutlinedButton.styleFrom(
side: BorderSide(
color: Color(0xFF44A5FF),
),
padding: EdgeInsets.zero,
),
IconData comes with some default hard-coded value.