GestureDetector buildButtonColumn(IconData iconData, String label,
{Function()? onTab}) {
var primaryColor = Colors.blue; // 主色
return GestureDetector(
onTap: () {
if (onTab != null) {
onTab();
}
},
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(iconData, color: primaryColor),
Container(
margin: const EdgeInsets.only(top: 8.0),
child: Text(label,
style: TextStyle(
fontSize: 12.0,
color: primaryColor,
fontWeight: FontWeight.w400,
)),
)
],
));
}
Widget buttonSection = Container(
padding: const EdgeInsets.only(left: 32.0, right: 32.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
buildButtonColumn(Icons.call, "call".toUpperCase(),
onTab: () => showToast(msg: "call")),
buildButtonColumn(Icons.near_me, "near_me".toUpperCase(),
onTab: () => showToast(msg: "near_me")),
buildButtonColumn(Icons.share, "share".toUpperCase(),
onTab: () => showToast(msg: "share")),
],
),
);
mainAxisAlignment: MainAxisAlignment.start
mainAxisAlignment: MainAxisAlignment.end
mainAxisAlignment: MainAxisAlignment.center
mainAxisAlignment: MainAxisAlignment.spaceBetween
mainAxisAlignment: MainAxisAlignment.spaceAround
mainAxisAlignment: MainAxisAlignment.spaceEvenly