widgetIcon method

Widget widgetIcon(
  1. IconData icon,
  2. String title, {
  3. Function? onTap,
})

widgetIcon to simplify create a button icon with text

Implementation

Widget widgetIcon(IconData icon, String title, {Function? onTap}) {
  return InkWell(
    onTap: onTap as void Function()?,
    child: Row(
      children: <Widget>[
        Icon(
          icon,
          color: Colors.black38,
          size: 20,
        ),
        Padding(
          padding: const EdgeInsets.only(left: 4),
          child: Text(
            title,
            style: const TextStyle(
                color: Colors.black54,
                fontSize: 16,
                fontWeight: FontWeight.w400),
          ),
        )
      ],
    ),
  );
}