Для этого можно использовать виджет IconButton
.
IconButton(
icon: Icon(Icons.info),
onPressed: (){
// Do something
},
)
из вас можно использовать GestureDetector
GestureDetector(
onTap: () {
//Do something
},
child: icon: Icon(Icons.info),
)
РЕДАКТИРОВАТЬ:
С небольшой модификацией кодов, вставленных ниже.Измените buildButtonColumn на это:
buildButtonColumn(icon, label, onTap) {
Color color = Theme.of(context).primaryColor;
return GestureDetector(
onTap: onTap,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(icon, color: color),
Container(
margin: const EdgeInsets.only(top: 8.0),
child: Text(
label,
style: TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w400,
color: color,
),
),
),
],
),
);
}
и для кнопки Section используйте это.
Widget buttonSection = Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
buildButtonColumn(Icons.call, 'CALL', (){
print('call');
}),
buildButtonColumn(Icons.near_me, 'ROUTE', (){
print('route');
}),
buildButtonColumn(Icons.share, 'SHARE', (){
print('share');
}),
],
),
);