menu static method

Widget menu({
  1. required String label,
  2. required IconData icon,
  3. required bool color,
  4. required Size size,
  5. required dynamic onTap(),
})

Implementation

static Widget menu(
    {required String label,
    required IconData icon,
    required bool color,
    required Size size,
    required Function() onTap}) {
  return GestureDetector(
    onTap: onTap,
    child: Container(
      margin: const EdgeInsets.only(left: 5, right: 5),
      padding:
          const EdgeInsets.only(left: 7.0, right: 7.0, top: 5.0, bottom: 5.0),
      decoration: BoxDecoration(
          border: Border.all(
              color: color
                  ? Colors.white38
                  : const Color.fromARGB(255, 18, 34, 73)),
          color: color
              ? const Color.fromARGB(255, 18, 34, 73)
              : const Color.fromARGB(255, 255, 255, 255),
          borderRadius: BorderRadius.circular(15)),
      child: Row(
        children: [
          Icon(
            icon,
            size: size.width * 0.035,
            color: color
                ? const Color.fromARGB(255, 255, 255, 255)
                : const Color.fromARGB(255, 18, 34, 73),
          ),
          const SizedBox(
            width: 5,
          ),
          Text(label,
              style: TextStyle(
                color: color
                    ? const Color.fromARGB(255, 255, 255, 255)
                    : const Color.fromARGB(255, 18, 34, 73),
                fontSize: size.width * 0.035,
              )),
        ],
      ),
    ),
  );
}