I have this Row widget in Flutter App with some IconButtons
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: Icon(Icons.skip_previous,
color: Colors.amber, size: 35),
onPressed: () {
setState(() {
pageIndex = 1;
});
}),
IconButton(
icon: Icon(Icons.arrow_left,
color: Colors.amber, size: 45),
onPressed: decIndex),
Text('Page $pageIndex',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.amber,
fontSize: 20,
fontWeight: FontWeight.bold)),
IconButton(
icon: Icon(Icons.arrow_right,
color: Colors.amber, size: 45),
onPressed: () {
incIndex(pageNumbers);
}),
IconButton(
icon: Icon(Icons.skip_next,
color: Colors.amber, size: 35),
onPressed: () {
setState(() {
pageIndex = pageNumbers;
});
}),
IconButton(
icon: Icon(Icons.location_searching,
color: Colors.amber, size: 35),
onPressed: () {
setState(() {
pageIndex = userPage;
});
}),
],
),
they display as shown in this image:
the red line is just to be clear the difference between elevations
I want make all items aligned on the same line through their center. How can I do that?

Using
sizeparameter on theIconis not a very good approach forIconButtonwidgets. You icon are becoming big and theIconButtons are not adapting to that expanded size, which is causing the icon to overflow.Instead, use the
iconSizeparameter on theIconButtonand give the same value you were giving to theIconand remove it from theIcon.