button static method

Widget button({
  1. required String title,
  2. dynamic icon,
  3. dynamic onPress,
})

Implementation

static Widget button({required String title, icon, onPress}) {
  return ElevatedButton(
      style: ElevatedButton.styleFrom(padding: const EdgeInsets.all(5.0)),
      onPressed: onPress,
      child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          if (icon != null) Icon(icon, size: 20),
          if (icon != null)
            const SizedBox(
              width: 5,
            ),
          Text(title),
        ],
      ));
}